In the documentation I see I can use my own UserAuth and UserAuthDetails tables.
How can I do the same for the UserAuthRole table ?
This won’t work :
new OrmLiteAuthRepository<MyUserAuth, MyUserAuthDetails, MyUserAuthRole>
Thank you !
In the documentation I see I can use my own UserAuth and UserAuthDetails tables.
How can I do the same for the UserAuthRole table ?
This won’t work :
new OrmLiteAuthRepository<MyUserAuth, MyUserAuthDetails, MyUserAuthRole>
Thank you !
No the UserAuthRole
table is not overridable but it does contain a Meta
string Dictionary you can populate with your own additional metadata.
If you just wanted to change the Role/Permission resolution behavior you can subclass it and override the APIs of IManageRoles
which is what uses the UserAuthRole
table for its behavior.
public interface IManageRoles
{
ICollection<string> GetRoles(string userAuthId);
ICollection<string> GetPermissions(string userAuthId);
void GetRolesAndPermissions(string userAuthId, out ICollection<string> roles, out ICollection<string> permissions);
bool HasRole(string userAuthId, string role);
bool HasPermission(string userAuthId, string permission);
void AssignRoles(string userAuthId,
ICollection<string> roles = null, ICollection<string> permissions = null);
void UnAssignRoles(string userAuthId,
ICollection<string> roles = null, ICollection<string> permissions = null);
}