Codota Logo
MSentryGMPrivilege.getRoles
Code IndexAdd Codota to your IDE (free)

How to use
getRoles
method
in
org.apache.sentry.provider.db.service.model.MSentryGMPrivilege

Best Java code snippets using org.apache.sentry.provider.db.service.model.MSentryGMPrivilege.getRoles (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: apache/sentry

private boolean isPrivilegeStale(MSentryGMPrivilege privilege) {
 if (privilege.getRoles().isEmpty()) {
  return true;
 }
 return false;
}
origin: apache/incubator-sentry

private TSentryPrivilegeMap toTSentryPrivilegeMap(Set<MSentryGMPrivilege> mPrivileges) {
 // Mapping of <Role, Set<Privilege>>.
 Map<String, Set<TSentryPrivilege>> tPrivilegeMap = Maps.newTreeMap();
 for (MSentryGMPrivilege mPrivilege : mPrivileges) {
  for (MSentryRole role : mPrivilege.getRoles()) {
   TSentryPrivilege tPrivilege = toTSentryPrivilege(mPrivilege);
   if (tPrivilegeMap.containsKey(role.getRoleName())) {
    tPrivilegeMap.get(role.getRoleName()).add(tPrivilege);
   } else {
    Set<TSentryPrivilege> tPrivilegeSet = Sets.newTreeSet();
    tPrivilegeSet.add(tPrivilege);
    tPrivilegeMap.put(role.getRoleName(), tPrivilegeSet);
   }
  }
 }
 return new TSentryPrivilegeMap(tPrivilegeMap);
}
origin: apache/sentry

private TSentryPrivilegeMap toTSentryPrivilegeMap(Set<MSentryGMPrivilege> mPrivileges) {
 // Mapping of <Role, Set<Privilege>>.
 Map<String, Set<TSentryPrivilege>> tPrivilegeMap = Maps.newTreeMap();
 for (MSentryGMPrivilege mPrivilege : mPrivileges) {
  for (MSentryRole role : mPrivilege.getRoles()) {
   TSentryPrivilege tPrivilege = toTSentryPrivilege(mPrivilege);
   if (tPrivilegeMap.containsKey(role.getRoleName())) {
    tPrivilegeMap.get(role.getRoleName()).add(tPrivilege);
   } else {
    Set<TSentryPrivilege> tPrivilegeSet = Sets.newTreeSet();
    tPrivilegeSet.add(tPrivilege);
    tPrivilegeMap.put(role.getRoleName(), tPrivilegeSet);
   }
  }
 }
 return new TSentryPrivilegeMap(tPrivilegeMap);
}
origin: apache/incubator-sentry

/**
 * Drop any role related to the requested privilege and its children privileges
 */
public void dropPrivilege(PrivilegeObject privilege,PersistenceManager pm) {
 MSentryGMPrivilege requestPrivilege = convertToPrivilege(privilege);
 if (Strings.isNullOrEmpty(privilege.getAction())) {
  requestPrivilege.setAction(getAction(privilege.getComponent(), Action.ALL).getValue());
 }
 /**
  * Get the privilege graph
  * populateIncludePrivileges will get the privileges that need dropped,
  */
 Set<MSentryGMPrivilege> privilegeGraph = Sets.newHashSet();
 privilegeGraph.addAll(populateIncludePrivileges(null, requestPrivilege, pm));
 for (MSentryGMPrivilege mPrivilege : privilegeGraph) {
  /**
   * force to load all roles related this privilege
   * avoid the lazy-loading
   */
  pm.retrieve(mPrivilege);
  Set<MSentryRole> roles = mPrivilege.getRoles();
  for (MSentryRole role : roles) {
   revokeRolePartial(requestPrivilege, mPrivilege, role, pm);
  }
 }
}
origin: apache/sentry

Set<MSentryRole> roles = dropPrivilege.getRoles();
for (MSentryRole role : roles) {
 revokeRolePartial(oldPrivilege, dropPrivilege, role, pm);
origin: apache/sentry

/**
 * Drop any role related to the requested privilege and its children privileges
 */
public void dropPrivilege(PrivilegeObject privilege,PersistenceManager pm) throws SentryUserException {
 MSentryGMPrivilege requestPrivilege = convertToPrivilege(privilege);
 if (Strings.isNullOrEmpty(privilege.getAction())) {
  requestPrivilege.setAction(getAction(privilege.getComponent(), Action.ALL).getValue());
 }
 /*
  * Get the privilege graph
  * populateIncludePrivileges will get the privileges that need dropped,
  */
 Set<MSentryGMPrivilege> privilegeGraph = Sets.newHashSet();
 privilegeGraph.addAll(populateIncludePrivileges(null, requestPrivilege, pm));
 for (MSentryGMPrivilege mPrivilege : privilegeGraph) {
  /*
   * force to load all roles related this privilege
   * avoid the lazy-loading
   */
  pm.retrieve(mPrivilege);
  Set<MSentryRole> roles = mPrivilege.getRoles();
  for (MSentryRole role : roles) {
   revokeRolePartial(requestPrivilege, mPrivilege, role, pm);
  }
 }
}
origin: apache/incubator-sentry

Set<MSentryRole> roles = dropPrivilege.getRoles();
for (MSentryRole role : roles) {
 revokeRolePartial(oldPrivilege, dropPrivilege, role, pm);
org.apache.sentry.provider.db.service.modelMSentryGMPrivilegegetRoles

Popular methods of MSentryGMPrivilege

  • <init>
  • appendRole
  • implies
    Return true if this privilege implies request privilege Otherwise, return false
  • removeRole
  • setAction
  • setAuthorizables
    Only allow strict hierarchies. That is, can level =1 be not null when level = 0 is null
  • getAction
  • getAuthorizables
  • getComponentName
  • getField
  • getGrantOption
  • getScope
  • getGrantOption,
  • getScope,
  • getServiceName,
  • isNULL,
  • notNULL,
  • setComponentName,
  • setField,
  • setGrantOption,
  • setRoles

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now