Package org.candlepin.auth

Examples of org.candlepin.auth.UserPrincipal


    @Test(expected = NotFoundException.class)
    public void undoImportforOwnerWithNoImports() {
        Owner owner1 = new Owner("owner-with-no-imports", "foo");
        ownerResource.createOwner(owner1);
        ownerResource.undoImports(owner1.getKey(),
            new UserPrincipal("JarjarBinks", null, true));
    }
View Full Code Here


        when(ec.lookupByTypeAndOwner(ExporterMetadata.TYPE_PER_USER, owner))
            .thenReturn(metadata);
        when(sc.listByOwner(owner)).thenReturn(new ArrayList<Subscription>());

        thisOwnerResource.undoImports(owner.getKey(),
            new UserPrincipal("JarJarBinks", null, true));
        List<ImportRecord> records = importRecordCurator.findRecords(owner);
        assertTrue(records.size() == 1);
        ImportRecord ir = records.get(0);
        assertTrue(ir.getStatus() == ImportRecord.Status.DELETE);
    }
View Full Code Here


    protected Consumer createConsumer(String consumerName) {
        Collection<Permission> perms = new HashSet<Permission>();
        perms.add(new OwnerPermission(owner, Access.ALL));
        Principal principal = new UserPrincipal(USER, perms, false);

        List<String> empty = Collections.emptyList();
        return createConsumer(consumerName, principal, empty);
    }
View Full Code Here

        if (user == null) {
            throw new BadRequestException("user " + username + " not found");
        }

        if (user.isSuperAdmin()) {
            return new UserPrincipal(username, null, true);
        }
        else {
            Principal principal = new UserPrincipal(username, user.getPermissions(), false);

            return principal;
        }
    }
View Full Code Here

TOP

Related Classes of org.candlepin.auth.UserPrincipal

Copyright © 2018 www.massapicom. 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.