Open Closed

Assign default permissions to Default statis roles with #5192


1
squaresunion created

Hello Guys, Does somebody know how to assign default permissions to default static roles. I would like to be set up those permission to static roles at the start of the application and administrator shouldnt be able to modify it. I already know how to create default static roles (AppRoleConfig.cs)

Thanks in advance for answering.


5 Answer(s)
  • 0
    alper created
    Support Team

    Is this what you're looking for? Static Roles Can Have Pre-Granted Permissions <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3334">https://github.com/aspnetboilerplate/as ... ssues/3334</a> This feature is in ABP v3.6.0

  • 0
    squaresunion created

    Yes but now I have bad suprise. I dont see the roles I hardcoded in the UI. What am I doing wrong? Shouldnt this be working?

    roleManagementConfig.StaticRoles.Add( new StaticRoleDefinition( StaticRoleNames.Host.Client, MultiTenancySides.Host) ); roleManagementConfig.StaticRoles.Add( new StaticRoleDefinition( StaticRoleNames.Host.Employees, MultiTenancySides.Host) );

  • 0
    squaresunion created

    I even tried to add those roles in the database initialisation and it is still not working. Dont see my new roles in the UI in the roles datalist. Can somebody help? Please?

  • 1
    squaresunion created

    Hello Guys, I was able to figure out how to do things here. Please take a look at this class TenantRoleAndUserBuilder and use the existing code as example.

  • 0
    alper created
    Support Team

    hi great news @SquaresUnion, thanks for your feedback