Author: shane.bryzak(a)jboss.com
Date: 2008-05-10 09:34:54 -0400 (Sat, 10 May 2008)
New Revision: 8151
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java
trunk/examples/seamspace/view/imagepermissions.page.xml
trunk/examples/seamspace/view/imagepermissions.xhtml
Log:
support for bulk granting of permissions
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java 2008-05-10
13:33:34 UTC (rev 8150)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ImagePermission.java 2008-05-10
13:34:54 UTC (rev 8151)
@@ -62,7 +62,7 @@
public void editPermission()
{
target = (MemberImage) permissionSearch.getTarget();
- recipient = permissionSearch.getSelectedPermission().getRecipient();
+ recipient = permissionSearch.getSelectedRecipient();
List<Permission> permissions = permissionManager.listPermissions(target);
@@ -139,8 +139,7 @@
}
permissionManager.grantPermissions(permissions);
-
- Conversation.instance().end();
+ Conversation.instance().endBeforeRedirect();
}
public List<Member> getAvailableFriends()
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java 2008-05-10
13:33:34 UTC (rev 8150)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/MemberImage.java 2008-05-10
13:34:54 UTC (rev 8151)
@@ -13,7 +13,8 @@
import org.jboss.seam.annotations.security.permission.Permissions;
@Permissions({
- @Permission(action = "view")
+ @Permission(action = "view"),
+ @Permission(action = "comment")
})
@Entity
public class MemberImage implements Serializable
Modified: trunk/examples/seamspace/view/imagepermissions.page.xml
===================================================================
--- trunk/examples/seamspace/view/imagepermissions.page.xml 2008-05-10 13:33:34 UTC (rev
8150)
+++ trunk/examples/seamspace/view/imagepermissions.page.xml 2008-05-10 13:34:54 UTC (rev
8151)
@@ -4,6 +4,9 @@
<page action="#{permissionSearch.refresh}">
<navigation from-action="#{imagePermission.createPermission}">
- <redirect view-id="/imagepermissiondetail.xhtml"/>
+ <redirect view-id="/imagepermissiondetail.xhtml"/>
</navigation>
+ <navigation from-action="#{imagePermission.editPermission}">
+ <redirect view-id="/imagepermissiondetail.xhtml"/>
+ </navigation>
</page>
\ No newline at end of file
Modified: trunk/examples/seamspace/view/imagepermissions.xhtml
===================================================================
--- trunk/examples/seamspace/view/imagepermissions.xhtml 2008-05-10 13:33:34 UTC (rev
8150)
+++ trunk/examples/seamspace/view/imagepermissions.xhtml 2008-05-10 13:34:54 UTC (rev
8151)
@@ -42,8 +42,8 @@
<h:dataTable
id="threads"
- value="#{permissions}"
- var="permission"
+ value="#{recipients}"
+ var="recipient"
styleClass="security"
cellspacing="0"
headerClass="header"
@@ -53,18 +53,21 @@
<f:facet name="header">
Recipient
</f:facet>
- #{permission.recipient}
+ #{recipient.name}
</h:column>
<h:column width="auto">
<f:facet name="header">
Actions Allowed
</f:facet>
- #{permission.action}
+ #{permissionSearch.getActions(recipient)}
</h:column>
<h:column width="auto">
<f:facet name="header">
Action
</f:facet>
+ <s:link value="Edit"
action="#{imagePermission.editPermission}"
+ rendered="#{s:hasPermission(permissionSearch.target,
'seam.revoke-permission')}"/>
+ <span> | </span>
<s:link value="Revoke All"
action="#{permissionSearch.revokeSelected}"
rendered="#{s:hasPermission(permissionSearch.target,
'seam.revoke-permission')}"
onclick="return confirmRevoke()"/>
Show replies by date