private Map listPermissions(HttpServletRequest request) {
    Map map = new LinkedHashMap();
    map.put(
        new Integer(BasePermission.ADMINISTRATION.getMask()),
        getApplicationContext()
            .getMessage("select.administer", null, "Administer", request.getLocale()));
    map.put(
        new Integer(BasePermission.READ.getMask()),
        getApplicationContext().getMessage("select.read", null, "Read", request.getLocale()));
    map.put(
        new Integer(BasePermission.DELETE.getMask()),
        getApplicationContext().getMessage("select.delete", null, "Delete", request.getLocale()));

    return map;
  }
示例#2
0
 /** DAO can save an acl entry without any error. */
 @Test
 public final void savesEntryWithoutErrors() {
   final AclClass clazz = new AclClass(this.getClass().getCanonicalName());
   final AclSid sid = new AclSid("*****@*****.**", true);
   final AclObjectIdentity ident = new AclObjectIdentity();
   ident.setAclClass(clazz);
   final Long obj = 123L;
   ident.setObjectId(obj);
   ident.setAclSid(sid);
   final AclEntry entry = new AclEntry();
   entry.setAclObject(ident);
   entry.setAclSid(sid);
   entry.setMask(BasePermission.WRITE.getMask() | BasePermission.READ.getMask());
   final AclEntry found = this.dao.save(entry);
   Assert.assertNotNull(found.getId());
   Assert.assertNotNull(found.getAclObject().getId());
   Assert.assertNotNull(found.getAclSid().getId());
   Assert.assertNotNull(found.getAclObject().getAclClass().getId());
 }