Question

Is there a straightforward way to determine if the user has admin rights in SDK2?

I looked through both the Rally.data.PreferenceManager and Rally.domain.User objects but nothing jumped out at me.

I'd like to add an extra tab to my App if the user is an admin-- if so I will allow them to save data in a preference object independent of the application. I realize they would only have rights to do this if they have admin rights, but I'd like to only display the tab if they have those rights in the first place.

Was it helpful?

Solution

There are some undocumented methods in 2.0rc2 which should provide this information for you. Note that the locations/signatures of these may change by the time another public sdk is released.

//Get the current environment's global context
var context = Rally.environment.getContext();

//Get the current user's permission set
var permissions = context.getPermissions();

The permissions object is an instance of Rally.auth.UserPermissions, which has the following pertinent methods:

... and more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top