Skip to content

Conversation

@stonebuzz
Copy link
Contributor

Since release 1.12.1 a bug appears from this PR #425

From Dictionnay Software form, it's impossible to add a criteria.
With super-admin profile it's OK

image

But with another profile and good right

image

It's impossible

image

The "Add" button disappear.

When plugin it's called from this hook

 $PLUGIN_HOOKS['post_item_form']['fields'] = ['PluginFieldsField',  'showForTab'];

the plugin tries to find a container for the object being viewed (RuleCriteria in this case)

The hook is called from CommonDBTM.class.php

image

  1. Here canEdit return true
  2. Here (after hook) can Edit return false

When plugin try to find a container related to the object this line break the check process (canEdit)

image

Here we can check directly the arg (instead of load object), because arg is determined by get_class function (which use an object)

@stonebuzz stonebuzz self-assigned this Aug 24, 2021
@stonebuzz stonebuzz requested a review from orthagh August 24, 2021 07:07
@orthagh orthagh merged commit 9e498a6 into pluginsGLPI:develop Aug 24, 2021
@orthagh orthagh modified the milestones: 1.12.7, 1.12.8 Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants