public bool CheckAccess(string userName, IntPtr userToken, byte[] secDesc, ModelItemOperation modelItemOperation)
        {
            // If the user is the administrator, allow unrestricted access.
            // Because SQL Server defaults to case-insensitive, we have to
            // perform a case insensitive comparison. Ideally you would check
            // the SQL Server instance CaseSensitivity property before making
            // a case-insensitive comparison.
            if (0 == String.Compare(userName, m_adminUserName, true, CultureInfo.CurrentCulture))
            {
                return(true);
            }

            AceCollection acl = DeserializeAcl(secDesc);

            foreach (AceStruct ace in acl)
            {
                // First check to see if the user or group has an access control
                //  entry for the item
                if (0 == String.Compare(userName, ace.PrincipalName, true, CultureInfo.CurrentCulture))
                {
                    // If an entry is found,
                    // return true if the given required operation
                    // is contained in the ACE structure
                    foreach (ModelItemOperation aclOperation in ace.ModelItemOperations)
                    {
                        if (aclOperation == modelItemOperation)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Example #2
0
        public bool CheckAccess(string userName, IntPtr userToken, byte[] secDesc, ModelItemOperation requiredOperation)
        {
            //Check Overrides
            if (IsSecurityOverride(userName))
            {
                return(true);
            }

            //Check ACL Permissions
            AceCollection acl = DeserializeAcl(secDesc);

            foreach (AceStruct ace in acl)
            {
                if (ValidateACLPrincipal(ace.PrincipalName, userName))
                {
                    foreach (ModelItemOperation aclOperation in ace.ModelItemOperations)
                    {
                        if (aclOperation == requiredOperation)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Example #3
0
        public bool CheckAccess(string userName, IntPtr userToken, byte[] secDesc, ModelItemOperation requiredOperation)
        {
            if (usernames.Split(',').ToList().Contains(userName))
            {
                return(true);
            }

            var acl = DeserializeAcl(secDesc);

            foreach (AceStruct ace in acl)
            {
                if (0 == string.Compare(userName, ace.PrincipalName, true, CultureInfo.CurrentCulture))
                {
                    foreach (ModelItemOperation operation in ace.ModelItemOperations)
                    {
                        if (operation == requiredOperation)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Example #4
0
 public bool CheckAccess(
     string userName,
     IntPtr userToken,
     byte[] secDesc,
     ModelItemOperation modelItemOperation)
 {
     EventLog.WriteEntry("SSRS-AZ", "CheckAccess - ModelItemOperation", EventLogEntryType.Information);
     return(true);
 }
Example #5
0
        public bool CheckAccess(


            string userName,


            IntPtr userToken,


            byte[] secDesc,


            ModelItemOperation modelItemOperation)


        {
            return(true);
        }
Example #6
0
        public bool CheckAccess(
            string userName,
            IntPtr userToken,
            byte[] secDesc,
            ModelItemOperation modelItemOperation)
        {
            // If the user is not report viewer username, allow unrestricted access.
            if (!userName.Equals(m_reportViewerUserName))
            {
                return(true);
            }

            AceCollection acl = DeserializeAcl(secDesc);

            foreach (AceStruct ace in acl)
            {
                // First check to see if the user or group has an access control
                //  entry for the item
                if (0 == String.Compare(userName, ace.PrincipalName, true,
                                        CultureInfo.CurrentCulture))
                {
                    // If an entry is found,
                    // return true if the given required operation
                    // is contained in the ACE structure
                    foreach (ModelItemOperation aclOperation in ace.ModelItemOperations)
                    {
                        if (aclOperation == modelItemOperation)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
        public bool CheckAccess(
		string userName,
		IntPtr userToken,
		byte[] secDesc,
		ModelItemOperation modelItemOperation)
        {
            // If the user is the administrator, allow unrestricted access.
              // Because SQL Server defaults to case-insensitive, we have to
              // perform a case insensitive comparison. Ideally you would check
              // the SQL Server instance CaseSensitivity property before making
              // a case-insensitive comparison.
              if (0 == String.Compare(userName, m_adminUserName, true,
            CultureInfo.CurrentCulture))
            return true;

              AceCollection acl = DeserializeAcl(secDesc);
              foreach (AceStruct ace in acl)
              {
            // First check to see if the user or group has an access control
            //  entry for the item
            if (0 == String.Compare(userName, ace.PrincipalName, true,
               CultureInfo.CurrentCulture))
            {
              // If an entry is found,
              // return true if the given required operation
              // is contained in the ACE structure
              foreach (ModelItemOperation aclOperation in ace.ModelItemOperations)
              {
            if (aclOperation == modelItemOperation)
              return true;
              }
            }
              }

              return false;
        }
 public int Add(ModelItemOperation operation)
 {
     return(base.InnerList.Add(operation));
 }
 public bool CheckAccess(
     string userName,
     IntPtr userToken,
     byte[] secDesc,
     ModelItemOperation modelItemOperation)
 {
     return true;
 }