Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formcreator does not appear do respect entities delimitations #2046

Closed
piovisqui opened this issue Dec 15, 2020 · 12 comments
Closed

formcreator does not appear do respect entities delimitations #2046

piovisqui opened this issue Dec 15, 2020 · 12 comments
Assignees
Milestone

Comments

@piovisqui
Copy link

Describe the bug
formcreator does not appear do respect entity delimitation.

To Reproduce
Steps to reproduce the behavior:

  1. Create a form on main entity > subentity1
  2. Create a form on main entity > subentity2
  3. Create items on each entity, like Locations
  4. Add the Location field on the forms
  5. Both forms show all Locations, although they are restricted to entity1 and entity 2
  6. Items restricted to main entity also show up.

Expected behavior
formcreator should respect the entities limits. Should not show items from other entity nor from the parent which are not marked visible to children.

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version formcreator 2.10.2 GLPI 9.4.6

Additional context
items tested were Locations, Network devices and an additional field created with custom fields plugin.

@btry
Copy link
Collaborator

btry commented Dec 15, 2020

Hi

Currently the plugin restricts the items to the active entities of the user. If your user is in "main entity" ans has recursivity, then he will see locations from all entities beliw the current one.

Your observation has similarities with an other recent feedback. It is considered to change the behaviour to use restrict the entities from the entity and recursion of the form. However this may lead to unwanted behavior in Formcreator 2.10.x. I plan to do the change in the next version. I still can build a patch for 2.10.x for validation purpose, then you may use it in production.

Please wait until I deliver the patch.

@btry btry added the bug label Dec 15, 2020
@btry btry self-assigned this Dec 15, 2020
@btry btry added this to the 2.11 milestone Dec 15, 2020
@btry
Copy link
Collaborator

btry commented Dec 15, 2020

related to #2023

@piovisqui
Copy link
Author

Thank you. Since the form is created on a certain entity, I believe it should take permission from there, not the users'.

@btry
Copy link
Collaborator

btry commented Dec 16, 2020

Hi

Please test the above patch and feedback. Be aware that if it works wel, I won't merge it in support/2.10.0. I'll merge it only in develop branch. It is your responsibility to use the patch on 2.10.x versions and store localy a copy of the patch (I sometimes clean my fork and delete obsolete branches)

@piovisqui
Copy link
Author

Well, I changed the code lines and nothing happened. I did stop/start apache.

All objects still show up instead just within the entity. I also tried with the self-service profile inside an specific entity.

@btry
Copy link
Collaborator

btry commented Dec 17, 2020

Hi

In which entity is your form ?

@piovisqui
Copy link
Author

My form is on Main entity -> entity 2. It shows everything from the main entity.

@btry
Copy link
Collaborator

btry commented Jan 6, 2021

Hi

I created the following context

The patch I submitted to you is not applied

  • a location with recursivity location A and an other without recursivity location B in root entity
  • a sub entity entity A under the root entity cotnaining a form. The form has a question of type Dropdown for locations
  • The sub entity Entity A has a location location C

I login with the user glpi and I position mlyself to Entity A
I open the form and use the preview tab
I develop the dropdown, and I see:

  • location A
  • location C
  • i don't see Location B

The result seems correct. Items in ancestor entities are visible only if they are recursive. In a debug session, I observed that the dropdown is properly configured by the plugin.

i think that the locations you wand to not see are recursive.

@btry
Copy link
Collaborator

btry commented Jan 12, 2021

Hi

Did you checked the recursive flag of your categories ?

@piovisqui
Copy link
Author

I did all checks and now a network device from entity A does not show up in B. thanks. The forms are contained aswell. Thank you.

@btry
Copy link
Collaborator

btry commented Jan 18, 2021

Hi

Then the patch solved the issue, right ? If yes, can I close ?

@piovisqui
Copy link
Author

Yes, closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants