Attribute permissions for mapped superclass?

Hi all,

I am having a problem with attribute permissions for attributes that are derived from a mapped superclass.
For example, the mapped superclass is Person and has a field “name”.
The derived class is Customer and I have set view permissions on all attributes.

Usually, in screens, everything works well but now I am trying to make a query for the count of Customers and I am using the ValueLoadContext for that:

ValueLoadContext context = ValueLoadContext.create()
                .setQuery(ValueLoadContext.createQuery("select count(e) from rlm_Customer e where = :name")
                        .setParameter("name", "William")

This fails because the query is parsed and the finds the property path in “checkValueQueryPermissions()” (line 954).
There it is checked if I have permission for Person:name and not Customer:name. I guess that happens because the ValueLoadContext is not typed like other queries? The problem is that I can’t give permissions to the mapped superclass because it does not show in the role editor. Would it be wise to just add the permission by hand in the text view of the role? Or is there another workaround?

Thank you very much in advance!

Hi Oliver,

Try to add the required permission to a design-time role definition, see Defining roles at design time.

Hi Konstantin,

Thank you, it is working now. But as I mentioned above, I had to add the permission in the text view of the role because the mapped superclass is not shown in the entities tab. Thanks again! :slight_smile: