Can someone show how to get current logged user? And how to chek his permissions, because this doesn't work?
var user = (UserDefinition)Authorization.UserDefinition;
if (!Authorization.HasPermission(PermissionKeys.Tenants))
query.Where(fldTenantId == user.TenantId);
Thank you!
The easiest way is to use the
Contextobjectto get the user id
Context.User.GetIdentifier()to get the user name
Context.User.Identity.NameTo get the permissions you can use:
Context.PermissionsandContext.Permissions.HasPermission