Ejemplo n.º 1
0
        private void UpdateAccess(FunctionTypeAttribute functionTypeAttribute, WrappedPageType functionType)
        {
            AccessTimer.Start();

            int functionTypeID = functionType.ID;

            var functionAccessControlList = ManageAccessHandler.GetACLOfFunctionType(functionTypeID);

            ContentFunctionType.Load(functionTypeID);

            var defaultAccessControlList = ManageAccessHandler.LoadDefaultAccessFunctionType();

            bool chanaged = false;

            foreach (var accessEntry in defaultAccessControlList.Where(a => functionAccessControlList.Exists(a.Key) == false).ToList())
            {
                functionAccessControlList.Add(accessEntry.Value);
                chanaged = true;
            }

            if (chanaged)
            {
                ManageAccessHandler.SaveAccessFunctionType(functionAccessControlList, null, functionTypeID);
                Logger.DebugFormat("UpdateAccess for {0}", functionTypeID);
            }

            AccessTimer.Stop();
        }
Ejemplo n.º 2
0
        private void UpdateAccess(FunctionTypeAttribute functionTypeAttribute, PageType functionType)
        {
            int functionTypeID = functionType.ID;

            var functionAccessControlList = ManageAccessHandler.GetACLOfFunctionType(functionTypeID);

            ContentFunctionType.Load(functionTypeID);

            var defaultAccessControlList = ManageAccessHandler.LoadDefaultAccessFunctionType();

            foreach (var accessEntry in defaultAccessControlList.Where(a => functionAccessControlList.Exists(a.Key) == false).ToList())
            {
                functionAccessControlList.Add(accessEntry.Value);
            }

            ManageAccessHandler.SaveAccessFunctionType(functionAccessControlList, null, functionTypeID);
        }