Ryan Williams
Ryan Williams

Reputation: 663

documentum dql return cabinets where r_accessor_permit > 2

Hi all I'm writing a program that is supposed to query a documentum installation to return a list of the cabinets or folders, i have a query that returns objects in a folder just fine but i am having trouble returning the root or home cabinet's visible cabinets I am trying to say something like

  select object_name from dm_cabinet where r_accessor_name = 'user' and r_accessor_permit >2 

so basically i want to return the objects in the dm cabinet for a given user but only return those which that user has a permission of 3 or higher. is there a way do to that?

is there a way to union the two tables for acl and dm_cabinet

Upvotes: 0

Views: 2232

Answers (2)

Miki
Miki

Reputation: 2517

dm_cabinet is subtype of dm_folder. That could help you. If you can make connection to Documentum repository with that specific user credentials, you just need to fetch objects without any filter whether this user can see it since Documetnum respects user rights regarding objects either way you are trying to fetch it.

If you can't make this connection than you need some custom coding. If that's the case I'll update my answer.

Upvotes: 2

eivamu
eivamu

Reputation: 3225

There are a few ways to do this, either with DQL or with DFC (Java). Whichever approach you choose, I'd recommend using a session that belongs to the actual user for whom you are trying to access cabinets/folders. I would not use a superuser (which could circumvent Documentum's security model).

If you are into coding this in Java anyway, the most flexible solution is to use DFC, or perhaps a combination of DFC and DQL. Once you get an IDfSysobject (cabinet, folder or document), you can use the getPermit() method which will give you the int you're after. Be sure to test this int against the static integers in the IDfACL interface -- avoid magic numbers.

For instance, put the desired objects into a list.

// assuming you have an initialized user session (not covered here)
IDfSession userSession;

List<String> readableCabinetsNames = new ArrayList<String>();

// will only return objects that the current user can see (browse or higher)
String dql = "SELECT r_object_id FROM dm_cabinet";

IDfQuery query = new DfQuery(dql);
IDfCollection coll = query.execute(userSession, IDfQuery.DF_READ_QUERY);
while (coll.next()) {
    IDfCabinet cabinet = (IDfCabinet) coll.getTypedObject();
    if (cabinet.getPermit() >= IDfACL.DF_PERMIT_READ) {
        String cabinetName = cabinet.getObjectName();
        readableCabinetsNames.add(cabinetName);
    }
}

This is just something from my memory to get you started, and it can be improved - a lot :)

Remember this: Both DQL and DFC will follow the Documentum security model. A user will never see an object for which they have no rights.

Upvotes: 2

Related Questions