public static bool CanModify(this UserProfile user, IDomainRestricted domain) { if (user.IsAdministrator) { return(true); } return(user.DomainId == domain.DomainId); }
public bool CanAccess( IDomainRestricted toCheck ) { return ( this.DomainId == toCheck.DomainId ); }
/* ---------------------------------------------------------------------------------------------------------- */ #region Class Members #endregion /* ---------------------------------------------------------------------------------------------------------- */ #region Constructors/Initialisation #endregion /* ---------------------------------------------------------------------------------------------------------- */ #region Public Methods /// <summary> /// Determines if the provided entity can be accessed by this domain. /// </summary> /// <param name="toCheck">The item to check access for.</param> public bool CanAccess(IDomainRestricted toCheck) { return(this.DomainId == toCheck.DomainId); }