示例#1
0
        public static VisibleDisplay GetFirstDisplay()
        {
            var source = GetFirst();

            var result = new VisibleDisplay
            {
                Id           = source.Id,
                Name         = source.Name,
                TenantId     = source.TenantId,
                AuthorId     = source.AuthorId,
                AuthorName   = source.AuthorName,
                TenantName   = source.TenantName,
                ContentType  = source.ContentType,
                FullUrl      = source.FullUrl,
                Height       = source.Height,
                Length       = source.Length,
                RegionKey    = source.RegionKey,
                ThumbUrl     = source.ThumbUrl,
                Width        = source.Width,
                IsImage      = true,
                IsActive     = true,
                DateCreated  = source.DateCreated,
                DateModified = source.DateModified
            };

            return(result);
        }
示例#2
0
        private VisibleDisplay Strip(VisibleDisplay item)
        {
            if (item.AuthorId == CurrentUser.Id ||
                (item.TenantId == CurrentUser.TenantId && CurrentUser.Right.CanAdmin))
            {
                item.CanEdit   = true;
                item.CanDelete = true;
            }

            return(item);
        }