コード例 #1
0
        public PermissionContext(ICurrentUserPermission currentUserPermission, IEntityType gridEntityConfiguration)
        {
            this.currentUserPermission   = currentUserPermission ?? throw new ArgumentNullException(nameof(currentUserPermission));
            this.gridEntityConfiguration = gridEntityConfiguration ?? throw new ArgumentNullException(nameof(gridEntityConfiguration));
            columnPermissions            = new Dictionary <string, PermissionAccess>();

            HasDeleteItemPermission = new GridAnotations(gridEntityConfiguration)
                                      .InlineEditOptions.DeletePermissionRestriction(currentUserPermission);
        }
コード例 #2
0
 public GridContextsFactory(
     IGridConfigurationProvider gridConfigurationProvider,
     ITypePropertyAccessorCache propertyValueAccessorCache,
     ICurrentUserPermission currentUserPermission,
     ILogger <GridContextsFactory> logger)
 {
     this.gridConfigurationProvider  = gridConfigurationProvider ?? throw new ArgumentNullException(nameof(gridConfigurationProvider));
     this.propertyValueAccessorCache = propertyValueAccessorCache ?? throw new ArgumentNullException(nameof(propertyValueAccessorCache));
     this.currentUserPermission      = currentUserPermission ?? throw new ArgumentNullException(nameof(currentUserPermission));
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.imutableRendererContextCache = new Dictionary <Type, ImutableGridRendererContext>();
 }
コード例 #3
0
        public ImutableGridRendererContext(
            IEntityType gridEntityConfiguration,
            ITypePropertyAccessor propertyValueAccessor,
            ICurrentUserPermission currentUserPermission)
        {
            valueFormatters              = new Dictionary <string, ValueFormatter>();
            specialColumnValues          = new Dictionary <string, RenderFragmentAdapter>();
            gridItemCollectionProperties = new List <PropertyInfo>();

            GridEntityConfiguration    = gridEntityConfiguration ?? throw new ArgumentNullException(nameof(gridEntityConfiguration));
            GetPropertyValueAccessor   = propertyValueAccessor ?? throw new ArgumentNullException(nameof(propertyValueAccessor));
            this.currentUserPermission = currentUserPermission ?? throw new ArgumentNullException(nameof(currentUserPermission));

            PermissionContext = new PermissionContext(currentUserPermission, gridEntityConfiguration);
        }
コード例 #4
0
        public ImutableGridRendererContext(
            IEntityType gridEntityConfiguration,
            ITypePropertyAccessor propertyValueAccessor,
            ICurrentUserPermission currentUserPermission)
        {
            valueFormatters     = new Dictionary <string, IValueFormatter>();
            specialColumnValues = new Dictionary <string, IRenderFragmentAdapter>();

            GridEntityConfiguration  = gridEntityConfiguration ?? throw new ArgumentNullException(nameof(gridEntityConfiguration));
            GetPropertyValueAccessor = propertyValueAccessor ?? throw new ArgumentNullException(nameof(propertyValueAccessor));

            PermissionContext = new PermissionContext(currentUserPermission, gridEntityConfiguration);
            GridConfiguration = new GridAnotations(gridEntityConfiguration);
            CssClasses        = GridConfiguration.CssClasses;
        }