You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by sb...@apache.org on 2012/07/24 03:32:29 UTC

[5/20] git commit: example application changes

example application changes


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/e44156c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/e44156c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/e44156c2

Branch: refs/heads/master
Commit: e44156c2f39966f13c733baffb5f5bf2b095dc45
Parents: 09d63dc
Author: Shane Bryzak <sb...@gmail.com>
Authored: Mon Jul 9 10:01:41 2012 +1000
Committer: Shane Bryzak <sb...@gmail.com>
Committed: Tue Jul 24 10:11:19 2012 +1000

----------------------------------------------------------------------
 deltaspike/examples/security-console/pom.xml       |   26 +++++
 .../securityconsole/action/CustomerAction.java     |    9 ++
 .../securityconsole/action/PermissionSearch.java   |   76 +++++++++++++++
 .../example/securityconsole/model/Customer.java    |    5 +
 .../securityconsole/model/ModelPopulator.java      |   30 ++++++
 .../util/EntityManagerProducer.java                |   13 +++
 .../WEB-INF/classes/META-INF/persistence.xml       |   14 +++
 .../classes/META-INF/security-console-ds.xml       |   15 +++
 .../security-console/src/main/webapp/home.xhtml    |    8 ++-
 .../src/main/webapp/managegroups.xhtml             |   59 +++++++++++
 .../src/main/webapp/managepermissions.xhtml        |   71 ++++++++++++++
 .../src/main/webapp/manageroletypes.xhtml          |   58 +++++++++++
 .../src/main/webapp/manageusers.xhtml              |   69 +++++++++++++
 .../security-console/src/main/webapp/menu.xhtml    |    4 +
 14 files changed, 456 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/pom.xml b/deltaspike/examples/security-console/pom.xml
index 0b6bf9a..7fd3c24 100644
--- a/deltaspike/examples/security-console/pom.xml
+++ b/deltaspike/examples/security-console/pom.xml
@@ -65,6 +65,12 @@
           <artifactId>geronimo-jpa_2.0_spec</artifactId>
         </dependency>        
 
+	<dependency>
+	  <groupId>org.apache.geronimo.specs</groupId>
+	  <artifactId>geronimo-ejb_3.0_spec</artifactId>
+	  <version>1.0.1</version>
+	</dependency>
+
     </dependencies>
 
     <profiles>
@@ -90,6 +96,7 @@
                 </dependency>
             </dependencies>
         </profile>
+        
         <profile>
             <id>Weld</id>
             <dependencies>
@@ -107,6 +114,25 @@
                 </dependency>
             </dependencies>
         </profile>
+        
+        <profile>
+            <id>jbossas7</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <configuration>
+                            <webResources>
+                                <resource>
+                                    <directory>src/main/resources-jbossas7</directory>
+                                </resource>
+                            </webResources>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>        
     </profiles>
     
     <build>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/CustomerAction.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/CustomerAction.java b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/CustomerAction.java
new file mode 100644
index 0000000..439b650
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/CustomerAction.java
@@ -0,0 +1,9 @@
+package org.apache.deltaspike.example.securityconsole.action;
+
+import javax.enterprise.inject.Model;
+
+@Model 
+public class CustomerAction 
+{
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/PermissionSearch.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/PermissionSearch.java b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/PermissionSearch.java
new file mode 100644
index 0000000..9b17942
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/action/PermissionSearch.java
@@ -0,0 +1,76 @@
+package org.apache.deltaspike.example.securityconsole.action;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.enterprise.inject.Model;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.ejb.Stateful;
+import javax.inject.Inject;
+
+import org.apache.deltaspike.example.securityconsole.model.Customer;
+import org.apache.deltaspike.security.api.permission.Permission;
+import org.apache.deltaspike.security.api.permission.PermissionManager;
+import org.apache.deltaspike.security.api.permission.PermissionQuery;
+
+@Stateful
+@Model
+public class PermissionSearch 
+{
+    private static final List<String> ENTITY_TYPES = Arrays.asList(new String[] {"Customer", "Project"});
+    
+    private String entityType = ENTITY_TYPES.get(0);
+    
+    @PersistenceContext
+    private EntityManager em;
+    
+    private Object resource;
+    private List<Permission> permissions;
+    
+    @Inject
+    private PermissionManager permissionManager;
+    
+    public String getEntityType()
+    {
+        return entityType;
+    }
+    
+    public void setEntityType(String entityType)
+    {
+        this.entityType = entityType;
+    }
+    
+    public List<String> getEntityTypes()
+    {
+        return ENTITY_TYPES;
+    }
+    
+    public List<Customer> getCustomers()
+    {
+        return em.createQuery("select C from Customer C").getResultList();
+    }
+    
+    public Object getResource()
+    {
+        return resource;
+    }
+    
+    public void setResource(Object resource)
+    {
+        this.resource = resource;
+    }
+    
+    public List<Permission> getPermissions()
+    {
+        if (permissions == null && resource != null)
+        {
+            permissions = permissionManager.createPermissionQuery()
+                    .setResource(resource)
+                    .getResultList();
+            
+        }
+        return permissions;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/Customer.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/Customer.java b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/Customer.java
index 5dd7d0c..276c149 100644
--- a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/Customer.java
+++ b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/Customer.java
@@ -46,4 +46,9 @@ public class Customer implements Serializable
     {
         this.lastName = lastName;
     }
+    
+    public String toString()
+    {
+        return String.format("%d: %s %s", id, firstName, lastName);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ModelPopulator.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ModelPopulator.java b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ModelPopulator.java
new file mode 100644
index 0000000..9045e14
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/model/ModelPopulator.java
@@ -0,0 +1,30 @@
+package org.apache.deltaspike.example.securityconsole.model;
+
+import javax.ejb.Stateless;
+import javax.inject.Named;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ * Populates the database with default values
+ *
+ */
+@Stateless
+public @Named class ModelPopulator 
+{
+    @PersistenceContext
+    private EntityManager em;
+    
+    public void populate()
+    {
+        Customer c = new Customer();
+        c.setFirstName("Shane");
+        c.setLastName("Bryzak");
+        em.persist(c);
+        
+        c = new Customer();
+        c.setFirstName("John");
+        c.setLastName("Smith");
+        em.persist(c);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/util/EntityManagerProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/util/EntityManagerProducer.java b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/util/EntityManagerProducer.java
new file mode 100644
index 0000000..1195bff
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/java/org/apache/deltaspike/example/securityconsole/util/EntityManagerProducer.java
@@ -0,0 +1,13 @@
+package org.apache.deltaspike.example.securityconsole.util;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+public class EntityManagerProducer 
+{
+    @Produces
+    @PersistenceContext
+    private EntityManager em;
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/persistence.xml b/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/persistence.xml
new file mode 100644
index 0000000..6242ac5
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/persistence.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+             version="2.0">
+    <persistence-unit name="securityConsoleDatabase">
+        <jta-data-source>java:jboss/datasources/SecurityConsoleDS</jta-data-source>
+        <properties>
+            <!-- Properties for Hibernate (default provider for JBoss AS) -->
+            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+            <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+        </properties>
+    </persistence-unit>
+</persistence>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/security-console-ds.xml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/security-console-ds.xml b/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/security-console-ds.xml
new file mode 100644
index 0000000..2cdb097
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/resources-jbossas7/WEB-INF/classes/META-INF/security-console-ds.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
+    <datasource 
+        jndi-name="java:jboss/datasources/SecurityConsoleDS" 
+        enabled="true" 
+        use-java-context="true" pool-name="securityconsoledb">
+        <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
+        <driver>h2</driver>
+        <pool></pool>
+        <security>
+            <user-name>sa</user-name>
+            <password></password>
+        </security>
+    </datasource>
+</datasources>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/webapp/home.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/webapp/home.xhtml b/deltaspike/examples/security-console/src/main/webapp/home.xhtml
index c8ae064..c680f7f 100644
--- a/deltaspike/examples/security-console/src/main/webapp/home.xhtml
+++ b/deltaspike/examples/security-console/src/main/webapp/home.xhtml
@@ -30,7 +30,13 @@
             </div>
 
             Tip: you can login with a username/password of demo/demo.
-
+        </h:form>
+        
+        <h:form>
+            <div>
+              <h:commandButton action="#{modelPopulator.populate}" value="Populate database"/>
+              (TODO - refactor this after DeltaSpike supports application initialization events)
+            </div>
         </h:form>
 
         <br style="clear:both"/>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/webapp/managegroups.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/webapp/managegroups.xhtml b/deltaspike/examples/security-console/src/main/webapp/managegroups.xhtml
new file mode 100644
index 0000000..a83e39c
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/webapp/managegroups.xhtml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                template="/WEB-INF/templates/default.xhtml">
+
+    <ui:define name="sidebar">
+        <ui:include src="menu.xhtml"/>
+    </ui:define>
+
+    <ui:define name="content">
+        <script type="text/javascript">
+            function confirmDelete() {
+                return confirm("Are you sure you wish to delete this group? This action cannot be undone.");
+            }
+        </script>
+
+        <h3>Manage Groups</h3>
+
+        <h:form>
+            <h:commandLink action="#{groupAction.createGroup}" value="Create new group"
+                           rendered="#{identity.hasPermission('seam.account', 'create')}"/>
+        </h:form>
+
+        <h:form>
+            <h:dataTable
+                    id="threads"
+                    value="#{groupSearch.groups}"
+                    var="group"
+                    styleClass="security"
+                    cellspacing="0"
+                    headerClass="header"
+                    rowClasses="odd,even"
+                    columnClasses=",,action">
+                <h:column width="auto">
+                    <f:facet name="header">
+                        Group name
+                    </f:facet>
+                    #{group.name}
+                </h:column>
+                <h:column id="action" width="auto">
+                    <f:facet name="header">
+                        Action
+                    </f:facet>
+
+                    <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'delete')}">
+                        <h:commandLink id="delete" value="Delete"
+                                       action="#{groupAction.deleteGroup(group.name, group.groupType)}"
+                                       onclick="return confirmDelete()"/>
+                    </ui:fragment>
+                </h:column>
+            </h:dataTable>
+        </h:form>
+
+        <br style="clear:both"/>
+
+    </ui:define>
+</ui:composition>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/webapp/managepermissions.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/webapp/managepermissions.xhtml b/deltaspike/examples/security-console/src/main/webapp/managepermissions.xhtml
new file mode 100644
index 0000000..1ca2c65
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/webapp/managepermissions.xhtml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                template="/WEB-INF/templates/default.xhtml">
+
+    <ui:define name="sidebar">
+        <ui:include src="menu.xhtml"/>
+    </ui:define>
+
+    <ui:define name="content">
+
+        <h3>Manage Permissions</h3>
+
+        <h:form>
+            <h:selectOneMenu id="entityType" value="#{permissionSearch.entityType}" onchange="this.form.submit();">
+              <f:selectItems value="#{permissionSearch.entityTypes}"></f:selectItems>
+            </h:selectOneMenu>
+            
+            <ui:fragment rendered="#{permissionSearch.entityType == 'Customer'}">
+              <h:selectOneMenu id="selectedCustomer" value="#{permissionSearch.resource}" onchange="this.form.submit();">
+                <f:selectItems value="#{permissionSearch.customers}"></f:selectItems>
+              </h:selectOneMenu>            
+            </ui:fragment>
+        
+            <ui:fragment rendered="#{permissionSearch.resource ne null}">
+              <h:dataTable
+                      id="threads"
+                      value="#{permissionSearch.permissions}"
+                      var="permission"
+                      styleClass="security"
+                      cellspacing="0"
+                      headerClass="header"
+                      rowClasses="odd,even"
+                      columnClasses=",,enabled,action">
+                  <h:column width="auto">
+                      <f:facet name="header">
+                          Recipient
+                      </f:facet>
+
+                  </h:column>
+                  <h:column id="enabled" width="auto">
+                      <!--f:facet name="header">
+                          Enabled
+                      </f:facet-->
+
+
+                  </h:column>
+                  <h:column id="action" width="auto">
+                      <!--f:facet name="header">
+                          Action
+                      </f:facet-->
+
+                      <!--ui:fragment rendered="#{identity.hasPermission('seam.identity', 'update')}">
+                          <h:commandLink id="edit" value="Edit" action="#{userAction.editUser(user.username)}"/>
+                          <span> | </span>
+                      </ui:fragment>
+                      <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'delete')}">
+                          <h:commandLink id="delete" value="Delete" action="#{userAction.deleteUser(user.username)}"
+                                         onclick="return confirmDelete()"/>
+                      </ui:fragment-->
+                  </h:column>
+              </h:dataTable>
+            </ui:fragment>
+        </h:form>
+
+        <br style="clear:both"/>
+
+    </ui:define>
+</ui:composition>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/webapp/manageroletypes.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/webapp/manageroletypes.xhtml b/deltaspike/examples/security-console/src/main/webapp/manageroletypes.xhtml
new file mode 100644
index 0000000..b5ddd6d
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/webapp/manageroletypes.xhtml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                template="/WEB-INF/templates/default.xhtml">
+
+    <ui:define name="sidebar">
+        <ui:include src="menu.xhtml"/>
+    </ui:define>
+
+    <ui:define name="content">
+        <script type="text/javascript">
+            function confirmDelete() {
+                return confirm("Are you sure you wish to delete this role type? This action cannot be undone.");
+            }
+        </script>
+
+        <h3>Manage Role Types</h3>
+
+        <h:form>
+            <h:commandLink action="#{roleAction.createRoleType}" value="Create new role type"
+                           rendered="#{identity.hasPermission('seam.account', 'create')}"/>
+        </h:form>
+
+        <h:form>
+            <h:dataTable
+                    id="threads"
+                    value="#{roleSearch.roleTypes}"
+                    var="role"
+                    styleClass="security"
+                    cellspacing="0"
+                    headerClass="header"
+                    rowClasses="odd,even"
+                    columnClasses=",,enabled,action">
+                <h:column width="auto">
+                    <f:facet name="header">
+                        Role type
+                    </f:facet>
+                    #{role}
+                </h:column>
+                <h:column id="action" width="auto">
+                    <f:facet name="header">
+                        Action
+                    </f:facet>
+
+                    <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'delete')}">
+                        <h:commandLink id="delete" value="Delete" action="#{roleAction.deleteRoleType(role)}"
+                                       onclick="return confirmDelete()"/>
+                    </ui:fragment>
+                </h:column>
+            </h:dataTable>
+        </h:form>
+
+        <br style="clear:both"/>
+
+    </ui:define>
+</ui:composition>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/webapp/manageusers.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/webapp/manageusers.xhtml b/deltaspike/examples/security-console/src/main/webapp/manageusers.xhtml
new file mode 100644
index 0000000..cf708c8
--- /dev/null
+++ b/deltaspike/examples/security-console/src/main/webapp/manageusers.xhtml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                template="/WEB-INF/templates/default.xhtml">
+
+    <ui:define name="sidebar">
+        <ui:include src="menu.xhtml"/>
+    </ui:define>
+
+    <ui:define name="content">
+        <script type="text/javascript">
+            function confirmDelete() {
+                return confirm("Are you sure you wish to delete this user? This action cannot be undone.");
+            }
+        </script>
+
+        <h3>Manage Users</h3>
+
+        <h:form>
+            <h:commandLink action="#{userAction.createUser}" value="Create New User"
+                           rendered="#{identity.hasPermission('seam.account', 'create')}"/>
+        </h:form>
+
+        <h:form>
+            <h:dataTable
+                    id="threads"
+                    value="#{userSearch.users}"
+                    var="user"
+                    styleClass="security"
+                    cellspacing="0"
+                    headerClass="header"
+                    rowClasses="odd,even"
+                    columnClasses=",,enabled,action">
+                <h:column width="auto">
+                    <f:facet name="header">
+                        User name
+                    </f:facet>
+                    #{user.username}
+                </h:column>
+                <h:column id="enabled" width="auto">
+                    <f:facet name="header">
+                        Enabled
+                    </f:facet>
+
+                    <div class="#{user.enabled ? 'checkmark' : 'cross'}"/>
+                </h:column>
+                <h:column id="action" width="auto">
+                    <f:facet name="header">
+                        Action
+                    </f:facet>
+
+                    <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'update')}">
+                        <h:commandLink id="edit" value="Edit" action="#{userAction.editUser(user.username)}"/>
+                        <span> | </span>
+                    </ui:fragment>
+                    <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'delete')}">
+                        <h:commandLink id="delete" value="Delete" action="#{userAction.deleteUser(user.username)}"
+                                       onclick="return confirmDelete()"/>
+                    </ui:fragment>
+                </h:column>
+            </h:dataTable>
+        </h:form>
+
+        <br style="clear:both"/>
+
+    </ui:define>
+</ui:composition>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e44156c2/deltaspike/examples/security-console/src/main/webapp/menu.xhtml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/security-console/src/main/webapp/menu.xhtml b/deltaspike/examples/security-console/src/main/webapp/menu.xhtml
index daaa7ec..9ad1b95 100644
--- a/deltaspike/examples/security-console/src/main/webapp/menu.xhtml
+++ b/deltaspike/examples/security-console/src/main/webapp/menu.xhtml
@@ -21,6 +21,10 @@
     <div class="menuitem">
         <a href="manageroletypes.jsf">Manage role types</a>
     </div>
+    
+    <div class="menuitem">
+        <a href="managepermissions.jsf">Manage permissions</a>
+    </div>
 
 </ui:composition>