If i have 4 final users: user A, B, C, ADMIN.
Admin can see the filter "USER" as it is, but user A, B and C can't change the selection of this filter ,which is pre-filtered by his name..
how can i do that?
There's another way to pre-filter a report when some user with higher privileges can se and filter user with lower privileges?
Hello, Lorenzo,
Thank you for contacting us.
Different reports can be loaded depending on the role of the user. For example, for some users filtering can be disabled or adjusted in the desired way. The component can even be presented in the read-only mode for chosen users.
The majority of options dedicated to the mentioned adjustments are properties of the options
object. You are welcome to learn more about it from our documentation.
Concerning your case, the described result can be achieved using the following approach:
filter
object. For example, only "A" users can be displayed in the following way:
"slice": {
"rows": [{
"uniqueName": "Type",
"filter": { "members": [ "type.[a]" ] }
},
{ "uniqueName": "Email" },
{ "uniqueName": "Name" },
{ "uniqueName": "Phone" }
]
}
You are welcome to get detailed information about filtering in our documentation.
mapping
object and the filters
property. Please see the following code snippet. It demonstrates disabling filtering by the "Type" hierarchy:
mapping: {
Type: { filters: false },
Email: {},
Name: {},
Phone: {}
}
Please note that each hierarchy from the data set needs to be mentioned in the mapping
object. Otherwise, it will be ignored by the component. More about the mapping
object itself can be found in our documentation.
We have prepared an example demonstrating the described approach.
However, in case the described approach is used, the user can still access the data about other users through filters of other hierarchies. In case such an access needs to be restricted as well, it is possible to use one of the following approaches:
showFilter
property of the grid
and chart
objects (properties of the options
object).
Please let us know if it works for your case.
Do not hesitate to contact us in case additional questions appear.
Best regards,
Illia