Difference between revisions of "Permissions En"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
m
(No difference)

Revision as of 14:23, 12 August 2009

Each permission has a unique ID. All permissions managed by Dolibarr are saved into Table llx_rights_def and has its own ID. This id is used to make link between a user and the permission (links are saved into Table llx_user_rights or to make link between groupe and the permission (links are saved into the Table llx_usergroup_rights).

Get permission and groups of a user

En verysmall.png Page waiting for translation. To translate, create an account, go back and clic on "Modify".
Fr verysmall.png Page en attente de traduction. Pour traduire, créez un compte, revenez et cliquez sur "Modifier".
Es verysmall.png Página a traducir. Para traducirla, cree una cuenta, vuelva a la página y haga clic en "editar".
It verysmall.png Pagina da tradurre. Per tradurla, crea un utente, torna indietro e clicca su "modifica".
Pt verysmall.png Página a aguardar por tradução. Para traduzir, crie uma conta, volte atrás e clique em "Modificar".
De verysmall.png Seite wartet auf Übersetzung. Um Übersetzung zu erstellen, richte einen Account ein, geh zurück und klicke auf "bearbeiten".
Zh verysmall.png 页面等待翻译。若要翻译本页,先创建一个帐户、登录并返回本页后单击“编辑”。

Dans une page de code Dolibarr, l'objet global $user est automatiquement défini. Il contient les informations sur l'utilisateur courant. Ces droits sont accessibles par un test

if ($user->rights->module->droit)

Pour connaitre les groupes auxquels un utilisateur appartient, on peut utiliser le code suivant (Dolibarr 2.5 ou plus):

$usergroup=new UserGroup($db);
$listofgroups=$usergroup->listGroupsForUser($fuser);
print $listofgroups[0]->nom;

$listofgroups étant un tableau de tous les objets UserGroups (les groupes) auxquels appartient l'utilisateur $fuser et $fuser étant un objet User chargé par

$fuser=new User($db);
$fuser->fetch('login');

Array of available permissions

Each module has its code string to use the $user->rights array to get its related permissions for user. List of code to use to read permissions are available of module developer documentation.

Click here to get full list of modules.