[MGNLUI-6920] Access availability rule not working on root level Created: 21/Oct/21  Updated: 02/Dec/21  Resolved: 30/Nov/21

Status: Closed
Project: Magnolia UI
Component/s: actionbar
Affects Version/s: 6.2.12
Fix Version/s: 6.2.14

Type: Bug Priority: Neutral
Reporter: Roberto Gaona Assignee: Andrei Ichimescu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive decoratorActionRoles.zip    
Issue Links:
Problem/Incident
Relates
relates to MGNLUI-6833 Default values on internationalized f... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Sprint: UI Maintenance 2
Story Points: 2

 Description   

Steps to reproduce

  1. Add the access and roles properties to an action's availability property and set root availability to true. (Find attached decoration as an example) 
  1. Login as an user who shouldn't be able to make use of such action due to the access rule. 

Expected results

Action on root level is blocked for users without the required roles.

This was achievable in Magnolia 5.7.11 using a similar configuration. 

Actual results

Action on root level is enabled for any user. 

Workaround

Development notes

It looks like the behaviour change is caused by the logic on the AbstractAvailabilityRule] class, which automatically bypasses any empty collection. 

 

This makes it so an empty collection (root case), always returns true regardless of the logged user. However, the behaviour in Magnolia 5.7.11 is different (AvailabilityChecker]), since in case of having an empty collection, the default ID (root node ID) is inserted, making possible to check the action availability.



 Comments   
Comment by Adam Siska [ 01/Dec/21 ]

RN: Access roles are not bypassed for root folder (empty selection of items)

Generated at Mon Feb 12 09:41:20 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.