Display Different Page Notices Based on User Role #1632
Replies: 1 comment
|
I like this idea. To extend on your design slightly, would it be worth considering a model based on overrides that also includes roles for future flexibility? A made up scenario might be that we want to show different help page text (currently accessible to all roles) based on both role and tag so that we can show people specific documentation for their role and facility. In the UI, very similarly to what you have now, the "Base Role" might become "Default", where you're editing the default page text unless you select an override for a specific role/tag combination to modify. The database might have a separate pagetext_override table that references the role as well as page text and tag, and has the replacement content. The existing pagetext could act as the default, with an override being used when there's a matching role/tag combination. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Motivation
The Central Laser Facility (CLF) has started using the proposals software and they need to be able to post CLF-specific notices for their users. Currently, there is no way to change the notice displayed to a user on a particular page based on any characteristic. The ISIS development team suggests extending the Page Editor functionality to allow User Officers to create notices based on tags. If a user is signed in as a derived role with that tag (currently assuming one tag per role), they will see the notice created for that tag on the page they are on. Relevant issue
Proof of Concept
Please see the below screenshots of a proof of concept for the page editor:
This will require changing the
pagetexttable to also reference tag id for finding the correct content.The code for the proof of concept is here. This POC only covers creating page notices, not displaying the correct one for derived roles. The dropdown menu for selecting a tag is hardcoded just for demonstration purposes.
SQL
The following is the SQL required for the proof of concept:
What are people's thoughts?
All reactions