/// <summary> /// Check if current user is allowed to perform a certain action. /// </summary> /// <param name="action">action to be checked.</param> /// <returns>true, if current user is allowed to perform action, false otherwise.</returns> public bool IsActionAllowed(CommunitiesAction action) { if (AllowedActions.ContainsKey(action)) { return(AllowedActions[action]); } return(false); }
public GroupContent AddPermission(CommunitiesAction action, MembershipRole role) { Permissions[action] = role; return(this); }
/// <summary> /// Check if current user is allowed to perform a certain action. /// </summary> /// <param name="action">action to be checked.</param> /// <returns>true, if current user is allowed to perform action, false otherwise.</returns> public bool IsActionAllowed(CommunitiesAction action) { return(AvailableActions.ContainsKey(action) && AvailableActions[action]); }