Closed tmatveyeva closed 9 years ago
Fixed
The issue isn't fixed in 6.1.1
Maven dependency:
<dependency>
<groupId>com.jaspersoft</groupId>
<artifactId>jrs-rest-java-client</artifactId>
<version>6.1.1</version>
</dependency>
Attribute:
<bean id="executeOnlyAttribute" class="com.jaspersoft.jasperserver.dto.authority.hypermedia.HypermediaAttribute">
<property name="name" value="ExecuteOnlyAttribute"/>
<property name="value" value="Execute Only Attribute value"/>
<property name="description" value="Execute Only Attribute description"/>
<property name="permissionMask" value="32"/>
<property name="secure" value="false"/>
<property name="inherited" value="true"/>
<property name="holder" value="tenant:/"/>
<property name="embedded" ref="executeOnlyPermissionContainer"/>
</bean>
<bean id="executeOnlyPermission" class="com.jaspersoft.jasperserver.dto.permissions.RepositoryPermission">
<property name="mask" value="0"/>
<property name="recipient" value="role:/ROLE_ADMINISTRATOR"/>
</bean>
<bean id="executeOnlyPermissionContainer" class="com.jaspersoft.jasperserver.dto.authority.hypermedia.HypermediaAttributeEmbeddedContainer">
<property name="repositoryPermissions">
<list value-type="com.jaspersoft.jasperserver.dto.permissions.RepositoryPermission">
<ref bean="executeOnlyPermission"/>
</list>
</property>
</bean>
Java code:
session.attributesService()
.attribute(executeOnlyAttribute.getName())
.setIncludePermissions(true)
.createOrUpdate(executeOnlyAttribute);
This will still create an administrate permission. I think to make it work in the client you need to pass HypermediaAttribute
, and not ClientUserAttribute
.
Fixed
If we have profile attribute defined as follows:
(Permission mask is different than administrate)
and run the following request:
Attribute is created, but permission mask would be 1 (administrate)