コード例 #1
0
        //public ContainerBase AdamOfField { get; set; }
        public FolderOfField(AdamAppContext <TFolderId, TFileId> adamContext, Guid entityGuid, string fieldName)
            : base(adamContext)
        {
            var adamOfField = new AdamOfField <TFolderId, TFileId>(AdamContext, entityGuid, fieldName);

            if (!AdamContext.Exists(adamOfField.Root))
            {
                return;
            }

            var f = AdamContext.Folder(adamOfField.Root);

            if (f == null)
            {
                return;
            }

            Path     = f.Path;
            Modified = f.Modified;
            SysId    = f.SysId;
            Created  = f.Created;
            Modified = f.Modified;

            // IAdamItem interface properties
            Name = f.Name;
            Url  = f.Url;
        }
コード例 #2
0
        internal AdamSecurityChecksBase Init(AdamContext adamContext, bool usePortalRoot, ILog parentLog)
        {
            Log.LinkTo(parentLog);
            var callLog = Log.Call <AdamSecurityChecksBase>();

            AdamContext = adamContext;

            var firstChecker          = AdamContext.Permissions.PermissionCheckers.First().Value;
            var userMayAdminSomeFiles = firstChecker.UserMay(GrantSets.WritePublished);
            var userMayAdminSiteFiles = firstChecker.GrantedBecause == Conditions.EnvironmentGlobal ||
                                        firstChecker.GrantedBecause == Conditions.EnvironmentInstance;

            UserIsRestricted = !(usePortalRoot
                ? userMayAdminSiteFiles
                : userMayAdminSomeFiles);

            Log.Add($"adminSome:{userMayAdminSomeFiles}, restricted:{UserIsRestricted}");

            return(callLog(null, this));
        }