Example #1
0
        /// <summary>
        /// Call handlers and check if deleting a property from the SO is allowed.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        protected bool IsDeleteAllowed(String key)
        {
            // Check internal handlers first
            foreach (ISharedObjectSecurity handler in _securityHandlers)
            {
                if (!handler.IsDeleteAllowed(this, key))
                {
                    return(false);
                }
            }
            // Check global SO handlers next
            IEnumerator handlers = GetSecurityHandlers();

            if (handlers == null)
            {
                return(true);
            }
            while (handlers.MoveNext())
            {
                ISharedObjectSecurity handler = handlers.Current as ISharedObjectSecurity;
                if (!handler.IsDeleteAllowed(this, key))
                {
                    return(false);
                }
            }
            return(true);
        }