Examples of ObjectIdentityImpl


Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

        assertFalse(obj.hashCode() == obj2.hashCode());
    }

    @Test
    public void longAndIntegerIdsWithSameValueAreEqualAndHaveSameHashcode() {
        ObjectIdentity obj = new ObjectIdentityImpl(Object.class, new Long(5));
        ObjectIdentity obj2 = new ObjectIdentityImpl(Object.class, Integer.valueOf(5));

        assertEquals(obj, obj2);
        assertEquals(obj.hashCode(), obj2.hashCode());
    }
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

        assertEquals(obj.hashCode(), obj2.hashCode());
    }

    @Test
    public void equalStringIdsAreEqualAndHaveSameHashcode() throws Exception {
        ObjectIdentity obj = new ObjectIdentityImpl(Object.class, "1000");
        ObjectIdentity obj2 = new ObjectIdentityImpl(Object.class, "1000");
        assertEquals(obj, obj2);
        assertEquals(obj.hashCode(), obj2.hashCode());
    }
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

        assertEquals(obj.hashCode(), obj2.hashCode());
    }

    @Test
    public void stringAndNumericIdsAreNotEqual() throws Exception {
        ObjectIdentity obj = new ObjectIdentityImpl(Object.class, "1000");
        ObjectIdentity obj2 = new ObjectIdentityImpl(Object.class, Long.valueOf(1000));
        assertFalse(obj.equals(obj2));
    }
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

        Assert.notNull(mutableAclService, "mutableAclService required");
    }

    public void addPermission(Contact contact, Sid recipient, Permission permission) {
        MutableAcl acl;
        ObjectIdentity oid = new ObjectIdentityImpl(Contact.class, contact.getId());

        try {
            acl = (MutableAcl) mutableAclService.readAclById(oid);
        } catch (NotFoundException nfe) {
            acl = mutableAclService.createAcl(oid);
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

    public void delete(Contact contact) {
        contactDao.delete(contact.getId());

        // Delete the ACL information as well
        ObjectIdentity oid = new ObjectIdentityImpl(Contact.class, contact.getId());
        mutableAclService.deleteAcl(oid, false);

        if (logger.isDebugEnabled()) {
            logger.debug("Deleted contact " + contact + " including ACL permissions");
        }
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

            logger.debug("Deleted contact " + contact + " including ACL permissions");
        }
    }

    public void deletePermission(Contact contact, Sid recipient, Permission permission) {
        ObjectIdentity oid = new ObjectIdentityImpl(Contact.class, contact.getId());
        MutableAcl acl = (MutableAcl) mutableAclService.readAclById(oid);

        // Remove all permissions associated with this particular recipient (string equality to KISS)
        List<AccessControlEntry> entries = acl.getEntries();
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

     * Displays the permission admin page for a particular contact.
     */
    @RequestMapping(value="/secure/adminPermission.htm", method=RequestMethod.GET)
    public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) {
        Contact contact = contactManager.getById(Long.valueOf(contactId));
        Acl acl = aclService.readAclById(new ObjectIdentityImpl(contact));

        Map<String, Object> model = new HashMap<String, Object>();
        model.put("contact", contact);
        model.put("acl", acl);

View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

                + "@" + person[1].toLowerCase() + ".com');");
        }

        // Create acl_object_identity rows (and also acl_class rows as needed
        for (int i = 1; i < createEntities; i++) {
            final ObjectIdentity objectIdentity = new ObjectIdentityImpl(Contact.class, new Long(i));
            tt.execute(new TransactionCallback<Object>() {
                    public Object doInTransaction(TransactionStatus arg0) {
                        mutableAclService.createAcl(objectIdentity);

                        return null;
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

        SecurityContextHolder.clearContext();
    }

    private void changeOwner(int contactNumber, String newOwnerUsername) {
        AclImpl acl = (AclImpl) mutableAclService.readAclById(new ObjectIdentityImpl(Contact.class,
                    new Long(contactNumber)));
        acl.setOwner(new PrincipalSid(newOwnerUsername));
        updateAclInTransaction(acl);
    }
View Full Code Here

Examples of org.springframework.security.acls.domain.ObjectIdentityImpl

    public int getCreateEntities() {
        return createEntities;
    }

    private void grantPermissions(int contactNumber, String recipientUsername, Permission permission) {
        AclImpl acl = (AclImpl) mutableAclService.readAclById(new ObjectIdentityImpl(Contact.class,
                    new Long(contactNumber)));
        acl.insertAce(acl.getEntries().size(), permission, new PrincipalSid(recipientUsername), true);
        updateAclInTransaction(acl);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.