mateusznitka / protocolsmanager

GLPI Plugin to report users inventory
8 stars 13 forks source link

You don't have permission to perform this action. #32

Open jcervantes-sipecom opened 3 years ago

jcervantes-sipecom commented 3 years ago

Hello,

I am having the problem that I indicate in the title. Detail:

When I try to create a document to a user who has no assigned equipment or items, so I am creating the document from 0.

image

When I click the CREATE button I get this error: "You don't have permission to perform this action."

image

The context, I am from a sub-entity, called SIPECOM, the root entity is GLPI.

image

The Default entity of the user is: GLPI> SIPECOM

image

The only error that appears to me with the DEBUG mode activated are the following:

image

In the browser's console it appears:

image

If I change to the root entity and try to generate the document again, the following appears:

image

image

/var/www/html/glpi/files/_log/sql-errors.log: SQL: INSERT INTO glpi_documents (entities_id, name, documentcategories_id, mime, date_mod, users_id, comment, filename, filepath, sha1sum, tag, date_creation) VALUES (NULL, '07082021_1739', '0', 'application/pdf', '2021-07-08 17:39:32', '7', 'Se recibe equipo por parte de XXXXXXXX por mantenimiento.', '82-07082021.pdf', 'PDF/67/3eb3b66e230a1ecbd604aa6f9af5e68a038538.PDF', '673eb3b66e230a1ecbd604aa6f9af5e68a038538', '7c57f0f5-d9d62df8-60e77ea48bc133.67950137', '2021-07-08 17:39:32')

And only in the error files are the following logs:

[2021-07-08 18:19:28] glpiphplog.NOTICE:   *** PHP Notice (8): Undefined variable: author in /var/www/html/glpi/plugins/protocolsmanager/inc/generate.class.php at line 255
  Backtrace :
  plugins/protocolsmanager/inc/generate.class.php:25 PluginProtocolsmanagerGenerate->showContent()
  inc/commonglpi.class.php:637                       PluginProtocolsmanagerGenerate::displayTabContentForItem()
  ajax/common.tabs.php:106                           CommonGLPI::displayStandardTab()

[2021-07-08 18:19:28] glpiphplog.NOTICE:   *** PHP Notice (8): Undefined variable: owner in /var/www/html/glpi/plugins/protocolsmanager/inc/generate.class.php at line 256
  Backtrace :
  plugins/protocolsmanager/inc/generate.class.php:25 PluginProtocolsmanagerGenerate->showContent()
  inc/commonglpi.class.php:637                       PluginProtocolsmanagerGenerate::displayTabContentForItem()
  ajax/common.tabs.php:106                           CommonGLPI::displayStandardTab()

[Thu Jul 08 18:19:17.772986 2021] [php7:notice] [pid 605722] [client IPInterno:45843] PHP Notice: Trying to access array offset on value of type null in /var/www/html/glpi/plugins/protocolsmanager/inc/template.php on line 163, referer: https://glpi.FQDN.TLD/front/user.form.php?id=186

And I think that the permissions in the plugin are correctly configured, in addition to the permissions in the plugin folder:

image

ls -lha /var/www/html/glpi/plugins/

image

image