Author: oching
Date: Mon Jun 7 08:15:53 2010
New Revision: 952136
URL: http://svn.apache.org/viewvc?rev=952136&view=rev
Log:
[MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a
"generic metadata" plugin
o allow only users with repo manager role to add & delete metadata content
o add archiva-add-metadata and archive-delete-metadata permissions
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml?rev=952136&r1=952135&r2=952136&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml
Mon Jun 7 08:15:53 2010
@@ -66,6 +66,16 @@
<description>Access Archiva Repository</description>
</operation>
<operation>
+ <id>archiva-add-metadata</id>
+ <name>archiva-add-metadata</name>
+ <description>Add Repository Metadata</description>
+ </operation>
+ <operation>
+ <id>archiva-delete-metadata</id>
+ <name>archiva-delete-metadata</name>
+ <description>Delete Repository Metadata</description>
+ </operation>
+ <operation>
<id>archiva-view-audit-logs</id>
<name>archiva-view-audit-logs</name>
<description>View Archiva Audit Logs</description>
@@ -230,6 +240,18 @@
<operation>archiva-view-audit-logs</operation>
<resource>${resource}</resource>
</permission>
+ <permission>
+ <id>archiva-add-metadata</id>
+ <name>Archiva Add Repository Metadata</name>
+ <operation>archiva-add-metadata</operation>
+ <resource>${resource}</resource>
+ </permission>
+ <permission>
+ <id>archiva-delete-metadata</id>
+ <name>Archiva Delete Repository Metadata</name>
+ <operation>archiva-delete-metadata</operation>
+ <resource>${resource}</resource>
+ </permission>
</permissions>
<childTemplates>
<childTemplate>archiva-repository-observer</childTemplate>
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf?rev=952136&r1=952135&r2=952136&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
Mon Jun 7 08:15:53 2010
@@ -25,30 +25,32 @@
<div>
<div>
- <s:form action="addMetadataProperty" namespace="/" method="post"
validate="true" theme="simple">
- <s:hidden name="groupId" value="%{groupId}" />
- <s:hidden name="artifactId" value="%{artifactId}" />
- <s:hidden name="version" value="%{version}" />
- <s:hidden name="repositoryId" value="%{repositoryId}" />
- <table>
- <tr>
- <td align="center"><strong>Property Name</strong></td>
- <td align="center"><strong>Property Value</strong></td>
- <td/>
- </tr>
- <tr>
- <td>
- <s:textfield name="propertyName" size="30" required="true"/>
- </td>
- <td>
- <s:textfield name="propertyValue" size="30" required="true"/>
- </td>
- <td align="right">
- <s:submit value="Add"/>
- </td>
- </tr>
- </table>
- </s:form>
+ <redback:ifAuthorized permission="archiva-add-metadata"
resource="${repositoryId}">
+ <s:form action="addMetadataProperty" namespace="/" method="post"
validate="true" theme="simple">
+ <s:hidden name="groupId" value="%{groupId}" />
+ <s:hidden name="artifactId" value="%{artifactId}" />
+ <s:hidden name="version" value="%{version}" />
+ <s:hidden name="repositoryId" value="%{repositoryId}" />
+ <table>
+ <tr>
+ <td align="center"><strong>Property Name</strong></td>
+ <td align="center"><strong>Property Value</strong></td>
+ <td/>
+ </tr>
+ <tr>
+ <td>
+ <s:textfield name="propertyName" size="30" required="true"/>
+ </td>
+ <td>
+ <s:textfield name="propertyValue" size="30" required="true"/>
+ </td>
+ <td align="right">
+ <s:submit value="Add"/>
+ </td>
+ </tr>
+ </table>
+ </s:form>
+ </redback:ifAuthorized>
</div>
<div>
@@ -68,9 +70,11 @@
<c:param name="deleteItem" value="${prop.key}"/>
</c:url>
<li>${prop.key}=${prop.value}
- <a href="${deletePropertyUrl}">
- <img src="<c:url value="/images/icons/delete.gif" />"
alt="Delete" width="12" length="12"/>
- </a>
+ <redback:ifAuthorized permission="archiva-delete-metadata"
resource="${repositoryId}">
+ <a href="${deletePropertyUrl}">
+ <img src="<c:url value="/images/icons/delete.gif" />"
alt="Delete" width="12" length="12"/>
+ </a>
+ </redback:ifAuthorized>
</li>
</c:forEach>
</ul>