By logged in user, I'm referring to the user that initiated the plugin 
installation.  If they are authorized to install the plugin,  by default I 
want to give that plugin rights to create a job on that CI server.

On Tuesday, October 24, 2017 at 11:59:55 AM UTC-5, Jesse Glick wrote:
>
> On Tue, Oct 24, 2017 at 12:35 PM, Shaun Thompson <sth...@gmail.com 
> <javascript:>> wrote: 
> > I'm programmatically creating a job when the 
> > user installs it's corresponding plugin. 
>
> This seems like a bad idea. 
>
> > How do I allow the job to create the project using the logged in user's 
> > abilities. 
>
> Who exactly is “the” logged-in user? The concept is meaningless unless 
> you are inside an HTTP request handling thread, or some rarer cases 
> like CLI commands—in which case `Jenkins.getAuthentication()` is set, 
> and so you can check `hasPermission(Item.CREATE)` and behave 
> accordingly. 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a48d24e5-cb95-45a5-bab9-2e8de218fd1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to