Spudwars
Spudwars

Reputation: 41

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

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?

Upvotes: 4

Views: 844

Answers (1)

luc
luc

Reputation: 43096

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

Upvotes: 2

Related Questions