You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make new PK (Name + RoleId). (This PK can make user in his context)
It's allow situation when DB contain two resources with the same name, but with different role.
Example:
Roles:
AdminRole
SuperAdminRole
Resources:
Name=OnlyAdminResource, RoleId = AdminRole
Name=OnlyAdminResource, RoleId = SuperAdminRole
In this example, we allow only AdminRole and SuperAdminRole, to call OnlyAdminResource
Also, need to update ResourceManager in overrides which receive IEnumerable<TResource> resources need to check if these resources has the same name. This move need to prevent this situation:
Roles:
UserRole
AdminRole
Resources:
Name=PublicResource, RoleId = UserRole
Name=AdminResource, RoleId = AdminRole
User call PublicResource and AdminResource with override which receive IEnumerable<TResource> resources and receive true because least one resource allow (in this situation allowed PublicResource)
The text was updated successfully, but these errors were encountered:
I see better way how to implement new logic:
Create overrides which can receive resources and instead of return boolean value true/false return array of resources which be allowed.
ArdenHide
changed the title
Update Resources table
Add logic for processing array of resources (two ways)
Aug 21, 2023
Make new PK (Name + RoleId). (This PK can make user in his context)
It's allow situation when DB contain two resources with the same name, but with different role.
Example:
Roles:
Resources:
In this example, we allow only AdminRole and SuperAdminRole, to call OnlyAdminResource
Also, need to update
ResourceManager
in overrides which receiveIEnumerable<TResource> resources
need to check if theseresources
has the same name. This move need to prevent this situation:Roles:
Resources:
User call PublicResource and AdminResource with override which receive
IEnumerable<TResource> resources
and receive true because least one resource allow (in this situation allowed PublicResource)The text was updated successfully, but these errors were encountered: