WaveBox.Core.Model.User.HasPermission C# (CSharp) Method

HasPermission() public method

public HasPermission ( Role role ) : bool
role Role
return bool
        public bool HasPermission(Role role)
        {
            return this.Role >= role ? true : false;
        }

Usage Example

Example #1
0
 // Standard permissions
 public bool CheckPermission(User user, string action)
 {
     switch (action)
     {
         // Write
         case "update":
             return user.HasPermission(Role.User);
         // Read
         case "read":
         default:
             return user.HasPermission(Role.Test);
     }
 }
All Usage Examples Of WaveBox.Core.Model.User::HasPermission