Hi Olivier,

You can check the membership of a user through the JahiaUser.isMemberOfGroup and JahiaUser.isAdminMember

You can access Object access rights through the .checkReadAccess, checkWriteAccess and checkAdminAccess on JahiaContainers for example.

You could set the rights from the template to be wired, but this is tricky to do as the container list doesn't yet exist until the first container has been inserted. You might need to use event listener to do this. We have a new chapter on event listeners in our template developer guide. As for setting the rights, you need to retrieve the JahiaBaseACL object on the content object you wish to modify and set the corresponding bits. I won't go into too many details because I'm not sure exactly what you are trying to achieve and you might not need this.

Regards,
 Serge Huber.

Olivier Vit wrote:

St�phane Croisier wrote:

I would like to define access rights required to access and update a container (file ipload, text field) in the template itself, testing the belonging to a given group.
Is this possible ? How ?

??? Access rights checks are implicitely already done by Jahia... So could you precise what you exactly tri to do? display an "edit" button in live mode for certain users on a certain container (cf: such a code is available in the blog_listing templates where you can add a new blog page directly in live mode if you have the adequate permissions). Or do you want to change permissions on the fly?

OV : I would like to restrict the access to certain boxes in edit to members of a given group, whithout having to set the right manually on each instance of the page template: I would like the access rigth to be wired, defined, in the template, and not set throught the user interface on each page

Can access rights be different for the same container but for each language ? a given group can edit the french version, another group the english version, and so on ...?

No, not for the moment as the permission is currently set at the container level and there is no check of permissions within the edition engine itself (excepted for the "folders"). Same is true for example for the locks. If a user edits a content object in a certain language, another user can not simultenously edit this object in another language.

OV : same as above, could we test that the user belongs to the group 'translator-<current-language>' to display the edit menu on the page for the current language and allow to switch to other languages ?

Thanks for your attention
Regards


Cheers,
St�phane


Thanks for your help

Olivier Vit





Reply via email to