You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-01-18 12:59:40

Webhead
Member
Registered: 2023-04-13
Posts: 6

Restrict certain fields for certain profiles

Would it be possible (in a general object I created) to restrct certain fields to be modified by anyone exept for instance the admin?
This would be fixed data not subjected to change and thus must be protected from employee hampering.

Offline

#2 2024-01-19 15:40:10

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: Restrict certain fields for certain profiles

No. Field-level permissions are not available in GLPI itself. You could always create a plugin to handle that though.

https://glpi-developer-documentation.re … index.html

Specifically, I would think such a plugin would use the "pre_item_update" plugin hook to unset the changes you deem to be not allowed by the current user and then add a new message that would be shown to the user explaining the issue with something like:
Session::addMessageAfterRedirect('You do not have permission to update these fields: ' . implode(', ', $list_of_unset_fields), false, ERROR)


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2024-04-15 14:19:26

Webhead
Member
Registered: 2023-04-13
Posts: 6

Re: Restrict certain fields for certain profiles

Thank you.

I'm still struggeling with plugins so this one would be a little over my head at current time.

Offline

Board footer

Powered by FluxBB