Examples of SID


Examples of org.springframework.security.acls.model.Sid

        Assert.assertTrue(principalSid.hashCode() != new PrincipalSid(new TestingAuthenticationToken("scott", "password")).hashCode());
    }

    public void testGrantedAuthoritySidHashCode() throws Exception {
        GrantedAuthority ga = new SimpleGrantedAuthority("ROLE_TEST");
        Sid gaSid = new GrantedAuthoritySid(ga);

        Assert.assertTrue(gaSid.hashCode() == "ROLE_TEST".hashCode());
        Assert.assertTrue(gaSid.hashCode() == new GrantedAuthoritySid("ROLE_TEST").hashCode());
        Assert.assertTrue(gaSid.hashCode() != new GrantedAuthoritySid("ROLE_TEST_2").hashCode());
        Assert.assertTrue(gaSid.hashCode() != new GrantedAuthoritySid(new SimpleGrantedAuthority("ROLE_TEST_2")).hashCode());
    }
View Full Code Here

Examples of org.springframework.security.acls.model.Sid

                if (parentAclId != 0) {
                    parentAcl = new StubAclParent(Long.valueOf(parentAclId));
                }

                boolean entriesInheriting = rs.getBoolean("entries_inheriting");
                Sid owner;

                if (rs.getBoolean("acl_principal")) {
                    owner = new PrincipalSid(rs.getString("acl_sid"));
                } else {
                    owner = new GrantedAuthoritySid(rs.getString("acl_sid"));
                }

                acl = new AclImpl(objectIdentity, id, aclAuthorizationStrategy, auditLogger, parentAcl, null,
                        entriesInheriting, owner);

                acls.put(id, acl);
            }

            // Add an extra ACE to the ACL (ORDER BY maintains the ACE list order)
            // It is permissible to have no ACEs in an ACL (which is detected by a null ACE_SID)
            if (rs.getString("ace_sid") != null) {
                Long aceId = new Long(rs.getLong("ace_id"));
                Sid recipient;

                if (rs.getBoolean("ace_principal")) {
                    recipient = new PrincipalSid(rs.getString("ace_sid"));
                } else {
                    recipient = new GrantedAuthoritySid(rs.getString("ace_sid"));
View Full Code Here

Examples of org.springframework.security.acls.model.Sid

            @RequestParam("sid") String sid,
            @RequestParam("permission") int mask) {

        Contact contact = contactManager.getById(new Long(contactId));

        Sid sidObject = new PrincipalSid(sid);
        Permission permission = permissionFactory.buildFromMask(mask);

        contactManager.deletePermission(contact, sidObject, permission);

        Map<String, Object> model = new HashMap<String, Object>();
View Full Code Here

Examples of org.springframework.security.acls.model.Sid

        }

        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        // Check if authorized by virtue of ACL ownership
        Sid currentUser = new PrincipalSid(authentication);

        if (currentUser.equals(acl.getOwner())
                && ((changeType == CHANGE_GENERAL) || (changeType == CHANGE_OWNERSHIP))) {
            return;
        }

        // Not authorized by ACL ownership; try via adminstrative permissions
View Full Code Here

Examples of org.springframework.security.acls.model.Sid

        if (permission instanceof Permission) {
            jtalksPermission = (Permission) permission;
        } else {
            jtalksPermission = getPermission(permission);
        }
        Sid sid = sidFactory.createPrincipal(authentication);
        List<AccessControlEntry> aces;
        List<GroupAce> controlEntries;

        try {
            aces = ExtendedMutableAcl.castAndCreate(mutableAclService.readAclById(objectIdentity)).getEntries();
View Full Code Here

Examples of org.springframework.security.acls.model.Sid

                return !isCheckAllowedGrant;
            }
            List<Group> groups = actualUser.getGroups();
            for (Group group : groups) {
                ObjectIdentity groupIdentity = aclUtil.createIdentity(group.getId(), "GROUP");
                Sid groupSid = sidFactory.create(group);
                List<AccessControlEntry> groupAces;
                try {
                    groupAces = ExtendedMutableAcl.castAndCreate(
                            mutableAclService.readAclById(groupIdentity)).getEntries();
                } catch (NotFoundException nfe) {
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.