Exemple #1
0
        /// <summary>
        /// Checks if the CurrentUser is allowed to access the specified facility group in the requested context.
        /// </summary>
        /// <param name="stat">The facility group access is being requested for.</param>
        /// <param name="requestContext">The context of the access request (how the result will be displayed and where)</param>
        /// <returns>True, if the request is allowed, false otherwise.</returns>
        public bool IsAllowed(
            FacilityGroup fac,
            SecureRequestContext requestContext)
        {
            if (!IsUseSecurityRules)
            {
                return(true);
            }

            bool isAllowed = false;

            if (fac == null)
            {
                Logger.LogError(5, "Access to a NULL facilityGroup cannot be allowed!");
                return(false);
            }

            List <GroupPermissions> contentAllowedGroups = null;

            isAllowed =
                IsContentAccessAllowed(fac.Dlf_ID, SecureRequestContext.ContentType.FACILITY_GROUP, out contentAllowedGroups);
            if (isAllowed)
            {
                isAllowed = IsRequestContextAllowed(contentAllowedGroups, requestContext);
            }

            return(isAllowed);
        }
 protected void sosFacility_ManageGroups(object sender, UcControlArgs e)
 {
     FacilityGroup.FacilityId = e.Id;
     FacilityGroup.UcDataBind();
     mvFacility.ActiveViewIndex = 1;
 }