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;
 }
示例#2
0
 public AccessType GetAccess(IService svc, UserRole role)
 {
     return _UsersPermissions.GetOperation(role.ID, svc.ServiceId);
 }
示例#3
0
 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;
         }
     }
 }
示例#4
0
 public UserRoleName( long languageID, string name, UserRole userRole )
 {
     this._languageID = languageID;
     this._name = name;
     this._userRole = userRole;
 }