Like title .I'm looking at the document about Authoration. I try to code like the document, but when I coding this "Configuration.Authorization.Providers.Add<MyAuthorizationProvider>();" I cant find how to use this configuration,I cant fine the namespace.Please help me .Thank you
4 Answer(s)
-
0
Can you share whole code? Have you defined auth provider? Which version of ABP are you using?
-
0
<cite>hikalkan: </cite> Can you share whole code? Have you defined auth provider? Which version of ABP are you using?
Version 0.6.2 . And I has upadate it ver 0.6.4 ,but always cant find it. Please help me check it ,thank you very muck
using Abp; using Abp.Authorization; namespace Foundation.Application { public class Permission : AuthorizationProvider { public override void SetPermissions(IPermissionDefinitionContext context) { var administrator = context.CreatePermission("Administrator", null); var userManagement = administrator.CreateChildPermission("Administrator.UserManagement"); userManagement.CreateChildPermission("Administrator.UserManagement.CreateUser"); var roleManagement = administrator.CreateChildPermission("Administrator.RoleManagement"); Configuration.Authorization.Providers.Add<Permission>(); } } }
-
0
Hi,
You are using Configuration.Authorization.Providers.Add<Permission>(); in the Permission class. It's not true. It should be done in PreInitialize method of your module (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Module-System#DocModulePreInit">http://www.aspnetboilerplate.com/Pages/ ... ulePreInit</a>). Also, "Permission" name is not good, I suggest to change it to MyPermissionProvider or something like that.
-
0
<cite>hikalkan: </cite> Hi,
You are using Configuration.Authorization.Providers.Add<Permission>(); in the Permission class. It's not true. It should be done in PreInitialize method of your module (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Module-System#DocModulePreInit">http://www.aspnetboilerplate.com/Pages/ ... ulePreInit</a>). Also, "Permission" name is not good, I suggest to change it to MyPermissionProvider or something like that.
Thank a lot ,I just read the module topic ,suddenly figured out ,thanks again patiently answered :D