We've built a heavily customized OEM Application for our product and I would like to know how to make certain things aware of the user role and hide/show them based on who logged in.
The example would be:
Thanks!
You cant easily create new capabilities. Suggest that you partner with splunk as OEM provider and use their support & resources to achieve this.
To clarify, i already have the capabilities to say add a new rule to a firewall from within our app. This question is in regards to even the most basic ability to say make a specific statistics table on an app only show up if the right user is logged in.
I'm talking about splunk capabilities like:
admin_all_objects, edit_lookups
http://docs.splunk.com/Documentation/Splunk/6.3.2/Security/Rolesandcapabilities
Have you created your own "splunk capability"? I doubt so.
So what you want to do is get a list of the user's (person running search) capabilities, see if the user has capability xyz, and if so display the edit button. Are you using an SDK? If so, which one?
For example in Python SDK, there is:
class splunklib.client.User(service, path, **kwargs)
This class represents a Splunk user.
Which has a method called "role_entities" which will return a list of the user's roles. You could make a role called can_see_edit_button... give that role to everyone you want to have the edit button.. then in your code check to see if splunklib.client.User(service,path).role_entities contains "can_see_edit_button" or not.