Skip to content

Having issue with permissions and claim #106

Description

@gigabytem

I was trying to implement roles and permissions in my project

these are my Permissions

public enum AquaPermissions : ushort
{
    .....
    [Display(GroupName = "MasterAdmin", Name = "Read masters", Description = "Can list masters")]
    ReadMaster = 3_000,

    [Display(GroupName = "MasterAdmin", Name = "Edit masters", Description = "Can edit masters")]
    EditMaster = 3_001,
   ....
}

and these are my RolesDefinition

 public static readonly List<BulkLoadRolesDto> RolesDefinition = new List<BulkLoadRolesDto>()
 {
     new("SuperAdmin", "Super admin - only use for setup", "AccessAll"),
     new("MasterAdmin","Master Admin - Have access to edit master","EditMaster, ReadMaster")
}

but the permissions are stored in what look like encrypted format (my locale is (IN , eng))

Screenshot 2024-01-25 173243

and when I get my token from the user after login , I am getting Permissions claim also in encrypted format.

Screenshot 2024-01-25 164434

when I decorate my endpoint with permissions {AquaPermissions.ReadMaster} it is not working
I have to hardcode it as the encrypted format ("ஹஸ" ) for it to work
is it how it is supposed to work ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions