Tabnine Logo
RolesACL.getRoles
Code IndexAdd Tabnine to your IDE (free)

How to use
getRoles
method
in
jrds.webapp.RolesACL

Best Java code snippets using jrds.webapp.RolesACL.getRoles (Showing top 3 results out of 315)

origin: fbacchella/jrds

@Override
public ACL join(ACL acl) {
  if(acl instanceof RolesACL) {
    Set<String> newRoles = new HashSet<String>(roles);
    newRoles.addAll(((RolesACL) acl).getRoles());
    return new RolesACL(newRoles);
  } else if(acl instanceof AdminACL) {
    Set<String> newRoles = new HashSet<String>(roles);
    newRoles.add(((AdminACL) acl).getAdminRole());
    return new RolesACL(newRoles);
  } else {
    return this;
  }
}
origin: fbacchella/jrds

private void addFilter(Filter newFilter) {
  filters.put(newFilter.getName(), newFilter);
  ACL acl = newFilter.getACL();
  if(acl instanceof RolesACL) {
    roles.addAll(((RolesACL) acl).getRoles());
  }
  log(Level.DEBUG, "Filter %s added with ACL %s", newFilter.getName(), newFilter.getACL());
}
origin: fbacchella/jrds

@Test
public void testSecurity() throws IOException {
  PropertiesManager pm = new PropertiesManager();
  pm.setProperty("configdir", testFolder.getRoot().getCanonicalPath());
  pm.setProperty("rrddir", testFolder.getRoot().getCanonicalPath());
  pm.setProperty("tmpdir", testFolder.getRoot().getCanonicalPath());
  pm.setProperty("security", "true");
  pm.setProperty("adminrole", "role1");
  pm.setProperty("defaultroles", " role2 ,role3");
  pm.update();
  Assert.assertEquals("Bad default ACL class", RolesACL.class, pm.defaultACL.getClass());
  RolesACL rolesacl = (RolesACL) pm.defaultACL;
  Assert.assertTrue("Admin role1 not found", rolesacl.getRoles().contains("role1"));
  Assert.assertTrue("default role role2 not found", rolesacl.getRoles().contains("role2"));
  Assert.assertTrue("default role role3 not found", rolesacl.getRoles().contains("role3"));
  Assert.assertEquals("Bad adminACL", AdminACL.class, pm.adminACL.getClass());
  AdminACL adminacl = (AdminACL) pm.adminACL;
  Assert.assertEquals("Bad admin role", "role1", adminacl.getAdminRole());
}
jrds.webappRolesACLgetRoles

Popular methods of RolesACL

  • <init>

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Notification (javax.management)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now