This component can be used to conditionally render other components (which we call access-controlled components) based on a single entity attribute permission.
This component can be used to conditionally render other components (which we call access-controlled components) based on a single entity (CRUD) permission.
To be used in (supposedly) unreachable code after exhaustive check of argument.
Initialization function that instantiates a ClientSideDataCollectionStore implementation
entity type.
name of the entity to be retrieved.
ClientSideDataCollectionStore configuration.
Initialization function that instantiates a DataCollectionStore implementation which uses Generic REST API as the source.
entity type.
name of the entity to be retrieved.
DataCollectionStore configuration.
Extracts file name from FileRef string
Transforms the antd Form fields values into format expected by Instance item, which is generally the same as the format expected by REST API, except that Instance item may have the following properties that are stripped before the commit:
localized entity property caption
A non-nullable version of getPropertyInfo
Initialization function that instantiates a DataInstanceStore.
entity type.
name of the entity to be retrieved.
DataInstanceStore configuration.
Transforms the provided item into the format expected by Ant Design Form fields.
entity type.
entity instance to be transformed.
entities metadata.
entity properties that should be included in the result. If not provided, all properties will be included.
Invokes Generic REST API to retrieve the lists of possible options for each Association attribute of a given entity
(possible options meaning entity instances that can be used as a value of that attribute).
Requests will be sent only for the attributes that the user is permitted to read.
Returns a Map where keys are associated entity names and values are DataCollectionStore instances (see CUBA React Core API Reference)
or undefined if the user doesn't have a permission to read the attribute.
The map is returned immediately, but each DataCollectionStore will only contain the retrieved options
once the corresponding request to Generic REST API is complete.
Upon successfull request, a DataCollectionStore will contain the retrieved options as its items property (MobX observable).
entity properties metadata
function returning user's permission for a given entity attribute
DataCollectionStore configuration options
a Map where keys are associated entity names and values are DataCollectionStore instances
that will (once the requests to Generic REST API are complete) contain
the retrieved options as their items property (MobX observable).
If the user doesn't have a permission to read some of the attributes, the corresponding values will contain
undefined.
Invokes Generic REST API to retrieve the possible options for an Association attribute
(i.e. entity instances that can be used as a value of that attribute).
The request will be sent only if the user has a permission to read that attribute.
Returns a DataCollectionStore instance (see CUBA React Core API Reference)
or undefined if the user doesn't have a permission to read the attribute.
The instance is returned immediately, but it will only contain the retrieved options
once the request to Generic REST API is complete.
The instance will contain the retrieved options as its items property (MobX observable).
name of the entity containing an Association attribute
name of the Association attribute
name of the entity contained in the Association attribute
function returning user's permission for a given entity attribute
DataCollectionStore configuration options
a DataCollectionStore instance that will (once the request to Generic REST API is complete)
contain the retrieved options as its items property (MobX observable).
If the user doesn't have a permission to read the attribute, an undefined will be returned instead.
Performs client-side sorting of entities, mimicking the way sorting is performed by REST API
entity instances array
REST API parameter representing sort field and order
a clone of provided Moment instance with milliseconds set to zero,
or undefined if a nullish value was provided.
A hook that returns a mutable ref object containing a DataCollectionStore initialized with provided entity name and options. The DataCollectionStore value will be preserved between renders.
entity type.
A hook that returns a mutable ref object containing a DataInstanceStore initialized with provided entity name and options. The DataInstanceStore value will be preserved between renders.
entity type.
A simple convenience hook that creates a reaction with provided expression, effect and options.
Reaction will be created only once (will not be disposed/recreated between renders).
Reaction will be automatically disposed when the component is unmounted.
If this reaction creates other reactions, those reactions will NOT be disposed.
In that case create a reaction manually inside a useEffect hook as described in
mobx-react documentation.
Generated using TypeDoc
This component can be used to conditionally render other components (which we call access-controlled components) based on user permissions and other conditions.
This component is intended to be used in complex cases (such as when requirements includes multiple types of permissions, e.g. an entity permission and a specific permission). In most cases simpler components should be used instead: EntityPermAccessControl when condition involves a single entity CRUD permission, AttrPermAccessControl when condition involves a single entity attribute permission.