Roles and templates are not correctly displayed when creating a series
Steps to reproduce
Steps to reproduce:
1. Login as a non-admin user with Admin UI privileged.
2. Open the "create series" wizard in the admin UI
3. Fill in the information and move forward until the "Access Policy" tab
4. Select one of the templates available
5. In the drop-down menus below, type a custom role (i.e. not internal; for instance, one that matches a pattern in custom.properties) in the drop-down menus below.
6. Select also a internal role in another line (ROLE_ANONYMOUS, for instance)
7. Go forward to the next tab and come back again
1. Templates can be selected, but they cause no effect in the roles below
2. If a template is selected, it can not be deleted again (such as with the "Branding" drop-down menu in the next tab)
3. The user's own role (e.g. ROLE_USER_<USERNAME>) can not be selected in the menu.
4. After returning to the tab, the custom roles are not displayed. The boxes display "Select an option", as if no role was selected. However the roles are currently display in the summary tab at the end of the wizard. The internal roles are displayed properly.
5. If we close the wizard and try to start over, we still see the information already provided. We must reload the page in order to clear all the information.
1. Templates should display the roles properly.
2. Role names should also be correctly displayed.
Workaround (if any):
About the "user role" issue: the user is read by LDAP. That's obviously a problem in the user provider. Thanks for pointing it out!
About templates: understood. But then, there should be a "No template" option and be the default. Or at least, it should be there to "apply a blank template" or whatever is considered the bare minimum (I don't know, is the current user's role applied by default or does it need to be given by the UI?)
After some more inspection on the problem, I think the fact that templates are not working for us may be caused by a merge error on our side. I'll take a further look as soon as I have some time to spare.
If we defaulted Read to ticked for new ACL entries, it would save a lot of spurious warnings in the dialog ("Rules have to contain a valid role and read or/and write right(s).")
I can see clearly issue #4 under Actual Results, as shown in the screenshots.
After returning to the tab, the custom roles are not displayed. The boxes display "Select an option", as if no role was selected. However the roles are currently display in the summary tab at the end of the wizard. The internal roles are displayed properly.
However, I can't see the other bugs and possibly they should be different issues.
For issue #3 (the user's own role e.g. ROLE_USER_<USERNAME> can not be selected in the menu) - how is this user created? i.e. is it an internal user visible in the UI under Organization / Users, or a user who logs in through a User Provider?
On the topic of "selecting a template", the action is really applying a template (rather than selecting one, in the sense of associating a template with the series). When a template is selected, the ACL is replaced with the set of roles from the template, but the template itself is not associated with the series in any persistent way. I think the UI could be clearer on this, i.e. change the wording to "Apply template". If you click next and then previous, the template drop-down is back to the default.
So there isn't an action of "deleting a template" as such in the Series Access Policy tab because after the template is selected, what's left is the roles which can be edited or a new set of roles can be selected by choosing another template.