Get Access Rights for another user with FileNet Java API

2.7k Views Asked by At

We have a build system on which we need to fetch documents for other user's builds. We don't have their password but only their login and we will use a service account. Is there a way to get the access rights for another principal with the FileNet API so we won't allow them to fetch something they don't have access to?

For performance sake, I would rather ask the CE to do the check instead of getting all permissions and checking them all one by one. Plus nested groups and security priority (direct/template/proxy) might slow things done a lot and make the code complex. Something like getAccessAllowed but given a principal or a User? If there is not, what would be the best way to do that?

I saw that get_MemberOfGroups deals with nested group but we still have to check against all the permissions, taking care of the source priority and deny/allow priority, which means re-implement the CE security strategy.

2

There are 2 best solutions below

3
On

You can create custom LoginModule to authenticate user without password, then you can work with CE as original user without service account.

But you need to add this users in FN objects ACL's with correct permissions.

0
On

If I got what you are saying right, I think the best way to do this is other way around. You don’t look what access right own by user and match with the document, you need to see what that user asking and he have right access levels. Best way is to use an Active directory with user groups and set permission for them document type vie. But let’s say same how you have set access permission on document’s side. When user call the document, get an Instance of it

Document  doc  =  Factory.Document.fetchInstance(os,ID,null);

And get the permission list

 AccessPermissionList parmissin = doc.Permissions;

And with loop get what permission is set for that document

 foreach (IAccessPermission owner in parmissin)
{
if (owner.GranteeName == "your loginuserpermission" )
{
 // you can cont your work
}
}

and keep a local Set of permission where you validate your user (db/txt) and if they match, use your service account user and show image and information.