After searching around on Google and asking in IRC (it's saturday, I wasn't
really expecting much activity ;) ), I've decided I should ask here.
What's the proper way to check if a user has permissions to do something?
Here's what I have:
if(currentUser.hasPermission(Permission.DELETE)) {
//procede with delete
}
So on my test Jenkins instance I set up Matrix security and a readonly
user. Here's what it looks like:
<https://lh3.googleusercontent.com/-yap_H49l5ko/USkzxcn4CSI/AAAAAAAACUM/zHJJvjz9kGE/s1600/Screen+Shot+2013-02-23+at+2.24.36+PM.png>
However, the above check always returns true. In fact, with a debugger I
tried every different Permission and it always returns true.
I'm writing a plugin that allows users to upload files to Jenkins and if
you have access to delete, you see a little "Delete" button, but I
obviously don't want just anyone to do that.
It seems like I'm completely missing something here. Any ideas?
Thanks,
-Joel
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.