cancel
Showing results for 
Search instead for 
Did you mean: 

create acl for collection

Former Member
0 Kudos

Hi all

i am trying to create acl for a collection.

i am looking for example to start with.

thanks in advance

regards

rami

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Please could you specify what you would like to do with the ACL:s to the collection e.g. set owner, change permission ? Should the collection support inheritance (inherent the ACL:s / permission of the parent Collection?)

Best regards

Raz

Former Member
0 Kudos

Rasmus,

I work with Rami on this issue, so I'll reply.

We create collection (folder A) programmatically (with

a few subfolders) and we need to set an ACL for this

folder - owner and readers. We also need subfolders

of A to inherit what we set for A.

Thanks,

YM

Former Member
0 Kudos

Hi,

did you check out the KM javadocs on this subject?

The classes handling ACL stuff are com.sapportals.wcm.util.acl.IACLManager and others in this package. You'll get an ACLManager either from the ACLManagerFactory or (AFAIK) from the repositoryManager of your resource/collection.

Regards,

Armin

Former Member
0 Kudos

"You'll get an ACLManager either from the ... repositoryManager of your resource/collection."

How?

I see how to set a collection and how to set an acl,

I just can't find how to tie them together...

detlev_beutner
Active Contributor
0 Kudos

Hi Yuri,

just a snapshot from some project:


IResourceAclManager aclMan = ((IAclSecurityManager)
    collection.getRepositoryManager().getSecurityManager(collection)).getAclManager();
IResourceAcl acl = aclMan.getAcl(collection);
if (acl == null) {
  acl = aclMan.createAcl(collection);
}
[...]

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev,

It helps a lot. Thank you.

But then I have to add an IAclEntry to the IResourceAcl

instance, right? And to create that entry I have to use

createAclEntry method of IResourceAclManager class, which

requires parameter of type IUMPrincipal. What jar file

contains that class and how do I assign this paramenter

to any group/user?

Thanks again,

Yuri

detlev_beutner
Active Contributor
0 Kudos

Hi Yuri,

> then I have to add an IAclEntry

> to the IResourceAcl instance, right?

Right.

> to create that entry I have to use

> createAclEntry method of IResourceAclManager class

Right.

> which requires parameter of type IUMPrincipal

Of course. IUMPricipal is the super interface for all kinds of principals - users, groups, roles; it's only a pity that this is the old EP5 UM classes, but look here for transformation help:

The whole API is very close to the UserInterface. If you have this in mind, it is very, very intuitive (the whole KM API is very intuitive, indeed; what cannot be said for a thousand other API parts within the rest of the portal).

> What jar file contains that class

Hm-mmm. Ok, for the 999th time

Take a screwdriver, open your computer, open your hard disk, open your eyes, take every jar from the hard disk, open it with the JarScrewDriver and look inside. Take care to put all things together as you have found them for getting your machine running again!

OK, it was a joke

Instead, take WinRAR or JARFinder or the tool in which you believe most for searching on a hard disk within JARs, and LOOK OUT

See

And: If you would have opened another thread for this, being able to reward points, I would have searched this time for you... but in this case... You will have to search... I will get a cup of coffee...

Best regards

Detlev

Former Member
0 Kudos

Detlev,

Thanks. Rami will reward you with points. I'll ask him.

Yuri.