Examples of SecuritySystem


Examples of org.sonatype.security.SecuritySystem

   */
  @Test
  public void testPrivileges()
      throws Exception
  {
    SecuritySystem plexusSecurity = this.lookup(SecuritySystem.class);

    PrincipalCollection principal = new SimplePrincipalCollection("admin-simple", new SimpleRealm().getName());

    // test one of the privleges that the admin user has Repositories - (create,read)
    Assert.assertTrue(plexusSecurity.isPermitted(principal, "nexus:repositories:create"));
  }
View Full Code Here

Examples of org.sonatype.security.SecuritySystem

   */
  @Test
  public void testPrivilegesInvalidUser()
      throws Exception
  {
    SecuritySystem plexusSecurity = this.lookup(SecuritySystem.class);

    PrincipalCollection principal = new SimplePrincipalCollection("INVALID", SecuritySystem.class.getSimpleName());

    // test one of the privleges
    Assert.assertFalse(plexusSecurity.isPermitted(principal, "nexus:repositories:create"));// Repositories -
    // (create,read)

  }
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.