I have a requirement to check if logged in user has User Level Create privilege on particular entity specified in Security Role.
I have tried the javascript as well that retrieves the Privilege entity and that checks for privilege but not working as per the expectation.
The javascript retrieves the roles of the user and privilege but it shows canbedeep, canbelocal, canbeglobal to true even if user role have only user level create privilege.
'<fetch mapping="logical" >',
'<entity name="role">',
'<attribute name="name" />',
'<link-entity name="systemuserroles" from="roleid" to="roleid">',
'<link-entity name="systemuser" from="systemuserid" to="systemuserid">',
'<filter>',
'<condition attribute="systemuserid" operator="eq-userid"/>',
'</filter>',
' </link-entity>',
'</link-entity>',
' <link-entity name="roleprivileges" from="roleid" to="roleid">',
' <link-entity name="privilege" from="privilegeid" to="privilegeid">',
' <attribute name="canbebasic" />',
' <attribute name="canbedeep" />',
' <attribute name="canbelocal" />',
' <attribute name="canbeglobal" />',
' <attribute name="accessright" />',
'<filter type="and">',
'<condition attribute="name" operator="eq" value="prvcreate' + entity + '" />',
'</filter>',
' </link-entity>',
' </link-entity>',
'</entity>',
' </fetch>'
Would somebody please help?