Thanks , it's what I was looking for.
However, I still don't understand the following snippet in the example
found in your link:
<j:if test="${h.hasPermission(app.ADMINISTER)}">
...
</j:if>
I'm not clear on what 'app' is, although it looks like the Jenkins object.
I've tried doing this:
<j:if test="${h.hasPermission(it.myCustomPermission)}">
...
</j:if>
And I have defined the getMyCustomPermission() method, but it doesn't work.
Maybe the 'it' variable is not correctly parsed when being inside ${h...}?
On Wed, Aug 15, 2012 at 3:25 PM, Jesse Glick <[email protected]> wrote:
> On 08/15/2012 11:53 AM, Nicky Ramone wrote:
>
>> In a plugin I'm writing, I need to hide a textbox in the project
>> configuration depending on the user permission.
>> My @DataBoundConstructor is in a Notifier class. How can I retrieve the
>> user permissions?
>>
>
> "Making your plugin behave in secured Jenkins" [1] discusses
> h.hasPermission which I think is what you want.
>
> [1] https://wiki.jenkins-ci.org/**display/JENKINS/Making+your+**
> plugin+behave+in+secured+**Jenkins<https://wiki.jenkins-ci.org/display/JENKINS/Making+your+plugin+behave+in+secured+Jenkins>
>