Forum Discussion
FICO
17 years agoCommunity Manager
Role based access at template level
Role based access at template level
Hi,
I am trying to implement role based access in the repository. This is not a problem for entities/items, but we also need to be able to restrict access to certain parts of our rulesets to certain roles.
In an ideal scenario, most of the users would have read only access to the information in the RMA, whereas editing would be restricted.
One way to solve this would be using conditional blocks in the display. That would allow me to represent a "normal" templetized/editable interface for user with the proper role(s), whereas other users could be shown a read only view of the data.
I have tried this approach, but my biggest problem with this as of now is that I need to find the username of the currently logged in user. With a username, I can request the corresponding roles from the LDAP server, and do the role based display based on those.
Does anyone have any ideas how to solve this? Either how to find the username/credentials so that I am able to implement the scenario described above, alternatively another way to do role based authorization/access at the template level?
Thanks!
Regards,
Jostein
3 Replies
- FICOCommunity Manager
Found it
public override string[] getAllowedInstantiationValues(NdProviderContext ctxt)
{ NdTemplateManager templateManager = ctxt.getTemplateManager(); NdWorkspace workspace = templateManager.getWorkspace(); NdRepositoryConnection repositoryConnection = workspace.getRepositoryConnection(); return new String[] { repositoryConnection.getUser() }; }Although I thought I had tried this already, I must have done something wrong the first time around...
Instead of returning repositoryConnection.getUser(), I obviously need to look up roles, but that is what the authorization manager is for ;-)
Regards,
Jostein
- FICOCommunity Manager
Hi Jostein,
We do need to implement role based access; Could you please let me know the steps to implement this.
It will be great help for us.
Thanks.
Ram.
- FICOCommunity Manager
Hi Ram,
I will try to let you know once I figure it out :-)
These posts concern work in progress, which means that I have not implemented a complete solution yet, and there are still pieces missing.
Please note that implementing role based access in itself is no problem, but you can only do it at the entry/item level (i.e. for each file or directory in the repository). What I am working on now is how to restrict access to individual value holders in a template. That means that you might have write access to the file itself, but you may not change everything in the file, for example general policy rules.
If what you need is role based authorization for files, all you need to do is to implement the com.blazesoft.repository.file.NdRepositoryAuthorizationManager. Your implementation would need to pick up roles based on username/password from some source (file/database/LDAP/AD/etc). You would also need to create a model that describes what any given role has access to.
Did that make sense?
Regards,
Jostein
Related Content
Related Content
Access rights to the Workbench data directory of Dockerized Workbench
I switched to Linux and found out that Linux version of Xpress does not include Workbench (nor IVE). (By the way, this information is rather hidden in the documentation.) I am therefore experimentin...11 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum7 unread comments7 unread1View0likes7Comments