fix: role acl.

oneRain 2021-04-29 15:56:11 +08:00
parent ba533e8a99
commit 2c81ae0c0d
1 changed files with 4 additions and 4 deletions

View File

@ -173,7 +173,7 @@ namespace LeanCloud.Storage {
if (role == null) { if (role == null) {
throw new ArgumentNullException(nameof(role)); throw new ArgumentNullException(nameof(role));
} }
string roleKey = $"{RoleKeyPrefix}{role.ObjectId}"; string roleKey = $"{RoleKeyPrefix}{role.Name}";
return GetAccess(ReadAccess, roleKey); return GetAccess(ReadAccess, roleKey);
} }
@ -186,7 +186,7 @@ namespace LeanCloud.Storage {
if (role == null) { if (role == null) {
throw new ArgumentNullException(nameof(role)); throw new ArgumentNullException(nameof(role));
} }
string roleKey = $"{RoleKeyPrefix}{role.ObjectId}"; string roleKey = $"{RoleKeyPrefix}{role.Name}";
SetAccess(ReadAccess, roleKey, value); SetAccess(ReadAccess, roleKey, value);
} }
@ -199,7 +199,7 @@ namespace LeanCloud.Storage {
if (role == null) { if (role == null) {
throw new ArgumentNullException(nameof(role)); throw new ArgumentNullException(nameof(role));
} }
string roleKey = $"{RoleKeyPrefix}{role.ObjectId}"; string roleKey = $"{RoleKeyPrefix}{role.Name}";
return GetAccess(WriteAccess, roleKey); return GetAccess(WriteAccess, roleKey);
} }
@ -212,7 +212,7 @@ namespace LeanCloud.Storage {
if (role == null) { if (role == null) {
throw new ArgumentNullException(nameof(role)); throw new ArgumentNullException(nameof(role));
} }
string roleKey = $"{RoleKeyPrefix}{role.ObjectId}"; string roleKey = $"{RoleKeyPrefix}{role.Name}";
SetAccess(WriteAccess, roleKey, value); SetAccess(WriteAccess, roleKey, value);
} }