@@ -23,7 +23,7 @@ public ConfigurationPermissionProvider(IConfiguration groupsConfig,
2323 public IConfiguration GroupsConfig { get ; protected set ; }
2424 public IConfiguration PlayersConfig { get ; protected set ; }
2525
26- public async Task < IEnumerable < string > > GetGrantedPermissionsAsync ( IPermissionEntity target , bool inherit = true )
26+ public async Task < IEnumerable < string > > GetGrantedPermissionsAsync ( IPermissionActor target , bool inherit = true )
2727 {
2828 PermissionSection section = target is IPermissionGroup
2929 ? ( PermissionSection ) await GetConfigSectionAsync < GroupPermissionSection > ( target , false )
@@ -52,7 +52,7 @@ public async Task<IEnumerable<string>> GetGrantedPermissionsAsync(IPermissionEnt
5252 return permissions . Distinct ( ) ;
5353 }
5454
55- public async Task < IEnumerable < string > > GetDeniedPermissionsAsync ( IPermissionEntity target , bool inherit = true )
55+ public async Task < IEnumerable < string > > GetDeniedPermissionsAsync ( IPermissionActor target , bool inherit = true )
5656 {
5757 PermissionSection section = target is IPermissionGroup
5858 ? ( PermissionSection ) await GetConfigSectionAsync < GroupPermissionSection > ( target , false )
@@ -81,10 +81,10 @@ public async Task<IEnumerable<string>> GetDeniedPermissionsAsync(IPermissionEnti
8181 return permissions . Distinct ( ) ;
8282 }
8383
84- public bool SupportsTarget ( IPermissionEntity target )
84+ public bool SupportsTarget ( IPermissionActor target )
8585 => target is IPermissionGroup || target is IUser ;
8686
87- public async Task < PermissionResult > CheckPermissionAsync ( IPermissionEntity target , string permission )
87+ public async Task < PermissionResult > CheckPermissionAsync ( IPermissionActor target , string permission )
8888 {
8989 GuardLoaded ( ) ;
9090 GuardPermission ( ref permission ) ;
@@ -132,7 +132,7 @@ public async Task<PermissionResult> CheckPermissionAsync(IPermissionEntity targe
132132 return PermissionResult . Default ;
133133 }
134134
135- public async Task < bool > AddPermissionAsync ( IPermissionEntity target , string permission )
135+ public async Task < bool > AddPermissionAsync ( IPermissionActor target , string permission )
136136 {
137137 GuardPermission ( ref permission ) ;
138138 GuardTarget ( target ) ;
@@ -148,15 +148,15 @@ public async Task<bool> AddPermissionAsync(IPermissionEntity target, string perm
148148 return true ;
149149 }
150150
151- public Task < bool > AddDeniedPermissionAsync ( IPermissionEntity target , string permission )
151+ public Task < bool > AddDeniedPermissionAsync ( IPermissionActor target , string permission )
152152 {
153153 GuardPermission ( ref permission ) ;
154154 GuardTarget ( target ) ;
155155
156156 return AddPermissionAsync ( target , "!" + permission ) ;
157157 }
158158
159- public async Task < bool > RemovePermissionAsync ( IPermissionEntity target , string permission )
159+ public async Task < bool > RemovePermissionAsync ( IPermissionActor target , string permission )
160160 {
161161 GuardPermission ( ref permission ) ;
162162
@@ -174,24 +174,24 @@ public async Task<bool> RemovePermissionAsync(IPermissionEntity target, string p
174174 return i > 0 ;
175175 }
176176
177- public async Task < bool > RemoveDeniedPermissionAsync ( IPermissionEntity target , string permission )
177+ public async Task < bool > RemoveDeniedPermissionAsync ( IPermissionActor target , string permission )
178178 {
179179 GuardPermission ( ref permission ) ;
180180 GuardTarget ( target ) ;
181181
182182 return await RemovePermissionAsync ( target , "!" + permission ) ;
183183 }
184184
185- public async Task < IPermissionGroup > GetPrimaryGroupAsync ( IPermissionEntity permissionEntity )
185+ public async Task < IPermissionGroup > GetPrimaryGroupAsync ( IPermissionActor permissionActor )
186186 {
187187 GuardLoaded ( ) ;
188- if ( ! ( permissionEntity is IUser ) )
188+ if ( ! ( permissionActor is IUser ) )
189189 throw new NotSupportedException ( ) ;
190190
191- return ( await GetGroupsAsync ( permissionEntity ) ) . OrderByDescending ( c => c . Priority ) . FirstOrDefault ( ) ;
191+ return ( await GetGroupsAsync ( permissionActor ) ) . OrderByDescending ( c => c . Priority ) . FirstOrDefault ( ) ;
192192 }
193193
194- public async Task < IEnumerable < IPermissionGroup > > GetGroupsAsync ( IPermissionEntity target )
194+ public async Task < IEnumerable < IPermissionGroup > > GetGroupsAsync ( IPermissionActor target )
195195 {
196196 GuardLoaded ( ) ;
197197 GuardTarget ( target ) ;
@@ -246,7 +246,7 @@ public async Task<bool> UpdateGroupAsync(IPermissionGroup group)
246246 return true ;
247247 }
248248
249- public async Task < bool > AddGroupAsync ( IPermissionEntity target , IPermissionGroup group )
249+ public async Task < bool > AddGroupAsync ( IPermissionActor target , IPermissionGroup group )
250250 {
251251 GuardLoaded ( ) ;
252252 GuardTarget ( target ) ;
@@ -264,7 +264,7 @@ public async Task<bool> AddGroupAsync(IPermissionEntity target, IPermissionGroup
264264 return true ;
265265 }
266266
267- public async Task < bool > RemoveGroupAsync ( IPermissionEntity target , IPermissionGroup group )
267+ public async Task < bool > RemoveGroupAsync ( IPermissionActor target , IPermissionGroup group )
268268 {
269269 GuardLoaded ( ) ;
270270 GuardTarget ( target ) ;
@@ -411,7 +411,7 @@ private void GuardPermissions(string[] permissions)
411411 }
412412 }
413413
414- private bool DeleteConfigSection ( IPermissionEntity target )
414+ private bool DeleteConfigSection ( IPermissionActor target )
415415 {
416416 IConfigurationElement config = target is IPermissionGroup
417417 ? GroupsConfig [ "Groups" ]
@@ -423,7 +423,7 @@ private bool DeleteConfigSection(IPermissionEntity target)
423423 return i > 0 ;
424424 }
425425
426- public async Task < T > GetConfigSectionAsync < T > ( IPermissionEntity target , bool createIfNotFound ) where T : PermissionSection
426+ public async Task < T > GetConfigSectionAsync < T > ( IPermissionActor target , bool createIfNotFound ) where T : PermissionSection
427427 {
428428 GuardTarget ( target ) ;
429429
@@ -487,7 +487,7 @@ private void GuardLoaded()
487487 throw new Exception ( "Players config has not been loaded" ) ;
488488 }
489489
490- private void GuardTarget ( IPermissionEntity target )
490+ private void GuardTarget ( IPermissionActor target )
491491 {
492492 if ( ! SupportsTarget ( target ) )
493493 throw new NotSupportedException ( target . GetType ( ) . FullName + " is not supported!" ) ;
0 commit comments