public bool HasPermission(Role role) { return this.Role >= role ? true : false; }
// 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); } }