public AccessType GetAccess(IService svc, UserRole role) { foreach (UserRoleServiceList ursvc in role.UserRoleServiceList) { if (ursvc.Service.ServiceID == svc.ServiceId) return (AccessType)ursvc.Operation; } return AccessType.None; }
public AccessType GetAccess(IService svc, UserRole role) { return _UsersPermissions.GetOperation(role.ID, svc.ServiceId); }
private void ApplyRoleView(UserRole role) { tabPage_Countries.PageEnabled = false; tabPage_Regions.PageEnabled = false; tabPage_Stores.PageEnabled = false; if (role != null) { //IAuthorizationService auth = ClientEnvironment.AuthorizationService; if (role.ID == (long) UserRoleId.CountryAdmin) { tabPage_Countries.PageEnabled = true; } if (role.ID == (long)UserRoleId.Controlling) { tabPage_Countries.PageEnabled = true; } else if (role.ID == (long)UserRoleId.RegionAdmin) { tabPage_Regions.PageEnabled = true; } else if (role.ID == (long) UserRoleId.StoreAdmin) { tabPage_Stores.PageEnabled = true; } } }
public UserRoleName( long languageID, string name, UserRole userRole ) { this._languageID = languageID; this._name = name; this._userRole = userRole; }