Nope, I was using Permission.READ

public static final Permission READ = new 
Permission(GROUP,"GenericRead",null,HUDSON_ADMINISTER);


 Also, in this case I want the boolean value since I display different 
elements on the page depending on permission (don't show the delete button 
if they can't delete. Don't show the form if they don't have permission to 
write). However, that's good to know.

I'll try using the Jenkins.READ/etc constants rather than the Permission 
class's. 

Thanks,

-Joel

On Monday, February 25, 2013 8:59:56 AM UTC-7, Jesse Glick wrote:
>
> On 02/23/2013 04:45 PM, JoelJ wrote: 
> > private boolean userHasPermission(Permission permission) { 
> >   ACL acl = Jenkins.getInstance().getACL(); 
> >   return acl.hasPermission(Jenkins.getAuthentication(), permission); 
> > } 
>
> Too much work. Usually you would just use something like: 
>
> someBuild.checkPermission(Run.DELETE); 
>
> and proceed, since this will throw an exception if the permission is not 
> granted. 
>
> > Permission.READ 
>
> Do you mean Jenkins.READ? 
>

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to