Django Rosetta - translate by user permission rather than "translators" group

821 Views Asked by At

How can I enable users to perform django-rosetta translations without assign each user in turn to the new translators auth group?

I currently have users associated to specific auth groups depending on their website role. I would like to assign a new auth permission, like: sites|sites|Can Translate and add this to an existing role. This will keep the minimal User administration so that users with the role of Gatekeeper will be assigned the the Gatekeeper auth group alone, and be able to translate.

Is this possible without hacking django-rosetta?

1

There are 1 best solutions below

0
On

It seems that rosetta has a ROSETTA_ACCESS_CONTROL_FUNCTION setting that makes possible to customize access permissions.

An alternative function that determines if a given user can access the translation views. This function receives a user as its argument, and returns a boolean specifying whether the passed user is allowed to use Rosetta or not.

I hope it helps