Giter VIP home page Giter VIP logo

Comments (4)

JonPSmith avatar JonPSmith commented on July 21, 2024

Have a look at

from authpermissions.aspnetcore.

gopskrish avatar gopskrish commented on July 21, 2024

Thanks Jon got an idea of how it works i still have one more problem let consider below roles and permissions
new (AquaRoles.SuperAdmin,
"Super admin - only use for setup", "AccessAll"),
new (AquaRoles.TenantAdmin,
"Tenant Admin - Have access to tenant management functionality", "TenantList, TenantCreate, TenantUpdate, TenantMove, TenantDelete"),
new (AquaRoles.TenantManager,
"Tenant Manager - Have access to create sub tenant", "TenantList, TenantCreate, TenantUpdate"),
new (AquaRoles.AppMaintenance,
"App status - app maintenance", "AppStatusList, AppStatusAllDown, AppStatusTenantDown, AppStatusRemove"),
new (AquaRoles.UserAdmin,
"User Manager", "UserRead, UserSync, UserChange, UserRolesChange, UserChangeTenant, UserRemove"),
new (AquaRoles.RolesAdmin,
"Role Manager", "RoleRead, RoleChange, PermissionRead, IncludeFilteredPermissions"),
new (AquaRoles.RoleReader,
"User", "RoleRead"),

I want to create a roles TenantSuperAdmin for whom i want to give all the access that are in otherRoles except superAdmin
and the TenantSuperAdmin have all the permission for that Tenant

Example let's consider slack:- The slack admin can do all the management and can also send message and do all the activities of all the other roles.

I want to create a roles similar to that so that in the future if i add a new roles and new permissions that TenantSuperAdmin will be add automatically and without any other intercession.
Below i an example of roles how i want the code to be
new (AquaRoles.TenantSuperAdmin,
"Tenant Super admin - Have access to all the all the tenant functionality ", "TenantAccessAll")
TenantAccessAll includes all the permissions of all that are added except for the superAdmin permission AccessAll

from authpermissions.aspnetcore.

JonPSmith avatar JonPSmith commented on July 21, 2024

Hi @gopskrish

If you want an Role like the "Tenant Super admin" you talked about then you have to create a Role by adding all the Permissions that control the tenant admin code. The SuperAdmin Role / AccessAll Permission are there for you to access your application's first deploy.

One way is to create code that would automatically create a Role that has all of the tenant permissions you need. Here is one way to do this:

  1. When creating your permissions add a GroupName something like "TenantAdmin".
  2. Then use the IAuthRolesAdminService's GetPermissionDisplay method and filter on the GroupName.
  3. Finally you use IAuthRolesAdminService's CreateRoleToPermissionsAsync method to create a Role containing the permissions from step 2. The Role should be a TenantAdminAdd type.

from authpermissions.aspnetcore.

gopskrish avatar gopskrish commented on July 21, 2024

Thanks @JonPSmith

from authpermissions.aspnetcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.