The above patch doesn't work because if user doesn't see the configuration and he submit the configuration, the privilege will be cleared.
This is my current solution

Modify src\main\resources\hudson\security\AuthorizationMatrixProperty\config.jelly

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    <j:if test="${h.hasPermission(app.ADMINISTER)}">
      <f:optionalBlock name="useProjectSecurity" title="${%Enable project-based security}" checked="${instance!=null}" xmlns:local="local">
        <st:include class="hudson.security.GlobalMatrixAuthorizationStrategy" page="config.jelly"/>
      </f:optionalBlock>
    </j:if>
    <j:if test="${!h.hasPermission(app.ADMINISTER)}">
      <f:optionalBlock name="useProjectSecurity" title="${%Enable project-based security}" checked="${instance!=null}" xmlns:local="local">
        <st:include class="hudson.security.GlobalMatrixAuthorizationStrategy" page="config_readonly.jelly"/>
      </f:optionalBlock>
    </j:if>
</j:jelly>

Clone a file from src\main\resources\hudson\security\GlobalMatrixAuthorizationStrategy\config.jelly to config_readonly.jelly
1. Modify line 36 to disable checkbox click

<f:checkbox name="[${p.id}]" checked="${instance.hasExplicitPermission(attrs.sid,p)}" _onclick_="return false" />

2. Delete line 41~50 to remove button

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to