Tabnine Logo
PrivilegeObject$Builder.withGrantOption
Code IndexAdd Tabnine to your IDE (free)

How to use
withGrantOption
method
in
org.apache.sentry.provider.db.generic.service.persistent.PrivilegeObject$Builder

Best Java code snippets using org.apache.sentry.provider.db.generic.service.persistent.PrivilegeObject$Builder.withGrantOption (Showing top 16 results out of 315)

origin: apache/incubator-sentry

.setAction(mPrivilege.getAction())
.setAuthorizables(mPrivilege.getAuthorizables())
.withGrantOption(mPrivilege.getGrantOption())
.build());
origin: apache/sentry

Set<PrivilegeObject> getPrivilegesByProvider(String component,
                       String service, Set<MSentryRole> roles,
                       List<? extends Authorizable> authorizables, PersistenceManager pm) {
 Set<PrivilegeObject> privileges = Sets.newHashSet();
 if (roles == null || roles.isEmpty()) {
  return privileges;
 }
 MSentryGMPrivilege parentPrivilege = new MSentryGMPrivilege(component, service, authorizables, null, null);
 Set<MSentryGMPrivilege> privilegeGraph = Sets.newHashSet();
 privilegeGraph.addAll(populateIncludePrivileges(roles, parentPrivilege, pm));
 for (MSentryGMPrivilege mPrivilege : privilegeGraph) {
  privileges.add(new Builder()
               .setComponent(mPrivilege.getComponentName())
               .setService(mPrivilege.getServiceName())
               .setAction(mPrivilege.getAction())
               .setAuthorizables(mPrivilege.getAuthorizables())
               .withGrantOption(mPrivilege.getGrantOption())
               .build());
 }
 return privileges;
}
origin: apache/incubator-sentry

public Set<PrivilegeObject> getPrivilegesByProvider(String component,
  String service, Set<MSentryRole> roles,
  List<? extends Authorizable> authorizables, PersistenceManager pm) {
 Set<PrivilegeObject> privileges = Sets.newHashSet();
 if (roles == null || roles.isEmpty()) {
  return privileges;
 }
 MSentryGMPrivilege parentPrivilege = new MSentryGMPrivilege(component, service, authorizables, null, null);
 Set<MSentryGMPrivilege> privilegeGraph = Sets.newHashSet();
 privilegeGraph.addAll(populateIncludePrivileges(roles, parentPrivilege, pm));
 for (MSentryGMPrivilege mPrivilege : privilegeGraph) {
  privileges.add(new Builder()
               .setComponent(mPrivilege.getComponentName())
               .setService(mPrivilege.getServiceName())
               .setAction(mPrivilege.getAction())
               .setAuthorizables(mPrivilege.getAuthorizables())
               .withGrantOption(mPrivilege.getGrantOption())
               .build());
 }
 return privileges;
}
origin: apache/incubator-sentry

.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(false).build();
origin: apache/sentry

.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(false).build();
origin: apache/incubator-sentry

.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(false)
.build();
  .setService(SERVICE)
  .setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
  .withGrantOption(null)
  .build();
origin: apache/incubator-sentry

.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
origin: apache/sentry

.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(false)
.build();
  .setService(SERVICE)
  .setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
  .withGrantOption(null)
  .build();
origin: apache/sentry

.setService(SERVICE)
.setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
origin: apache/incubator-sentry

.setService(SERVICE)
.setAuthorizables(Collections.singletonList(new Collection(COLLECTION_NAME)))
.withGrantOption(null)
.build();
.setService(SERVICE)
.setAuthorizables(Collections.singletonList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
.setService(SERVICE)
.setAuthorizables(Collections.singletonList(new Collection(COLLECTION_NAME)))
.withGrantOption(false)
.build();
origin: apache/sentry

.setService(SERVICE)
.setAuthorizables(Collections.singletonList(new Collection(COLLECTION_NAME)))
.withGrantOption(null)
.build();
.setService(SERVICE)
.setAuthorizables(Collections.singletonList(new Collection(COLLECTION_NAME)))
.withGrantOption(true)
.build();
.setService(SERVICE)
.setAuthorizables(Collections.singletonList(new Collection(COLLECTION_NAME)))
.withGrantOption(false)
.build();
origin: apache/sentry

.setAction(mPrivilege.getAction())
.setAuthorizables(mPrivilege.getAuthorizables())
.withGrantOption(mPrivilege.getGrantOption())
.build());
origin: apache/sentry

@Test
public void testGrantWithGrantOption() throws Exception {
 addGroupsToUser(GRANT_OPTION_USER, GRANT_OPTION_GROUP);
 addGroupsToUser(NO_GRANT_OPTION_USER, NO_GRANT_OPTION_GROUP);
 writePolicyFile();
 String roleName1 = "r1";
 String grantor = "g1";
 sentryStore.createRole(SEARCH, roleName1, grantor);
 /**
  * grant query privilege to role r1 with grant option
  */
 PrivilegeObject queryPrivilege = new Builder()
   .setComponent(SEARCH)
   .setAction(SolrConstants.QUERY)
   .setService(SERVICE)
   .setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
   .withGrantOption(true)
   .build();
 sentryStore.alterRoleGrantPrivilege(SEARCH, roleName1, queryPrivilege,ADMIN_USER);
 sentryStore.alterRoleAddGroups(SEARCH, roleName1,
   Sets.newHashSet(GRANT_OPTION_GROUP), grantor);
 /**
  * the user with grant option grant query privilege to rolr r2
  */
 String roleName2 = "r2";
 sentryStore.createRole(SEARCH, roleName2, grantor);
 sentryStore.alterRoleGrantPrivilege(SEARCH, roleName2, queryPrivilege, GRANT_OPTION_USER);
 assertEquals(Sets.newHashSet(queryPrivilege),
   sentryStore.getPrivilegesByRole(SEARCH, Sets.newHashSet(roleName2)));
}
origin: apache/incubator-sentry

@Test
public void testGrantWithGrantOption() throws Exception {
 addGroupsToUser(GRANT_OPTION_USER, GRANT_OPTION_GROUP);
 addGroupsToUser(NO_GRANT_OPTION_USER, NO_GRANT_OPTION_GROUP);
 writePolicyFile();
 String roleName1 = "r1";
 String grantor = "g1";
 sentryStore.createRole(SEARCH, roleName1, grantor);
 /**
  * grant query privilege to role r1 with grant option
  */
 PrivilegeObject queryPrivilege = new Builder()
   .setComponent(SEARCH)
   .setAction(SearchConstants.QUERY)
   .setService(SERVICE)
   .setAuthorizables(Arrays.asList(new Collection(COLLECTION_NAME)))
   .withGrantOption(true)
   .build();
 sentryStore.alterRoleGrantPrivilege(SEARCH, roleName1, queryPrivilege,ADMIN_USER);
 sentryStore.alterRoleAddGroups(SEARCH, roleName1,
   Sets.newHashSet(GRANT_OPTION_GROUP), grantor);
 /**
  * the user with grant option grant query privilege to rolr r2
  */
 String roleName2 = "r2";
 sentryStore.createRole(SEARCH, roleName2, grantor);
 sentryStore.alterRoleGrantPrivilege(SEARCH, roleName2, queryPrivilege, GRANT_OPTION_USER);
 assertEquals(Sets.newHashSet(queryPrivilege),
   sentryStore.getPrivilegesByRole(SEARCH, Sets.newHashSet(roleName2)));
}
origin: apache/incubator-sentry

private PrivilegeObject toPrivilegeObject(TSentryPrivilege tSentryPrivilege) {
 Boolean grantOption;
 if (tSentryPrivilege.getGrantOption().equals(TSentryGrantOption.TRUE)) {
  grantOption = true;
 } else if (tSentryPrivilege.getGrantOption().equals(TSentryGrantOption.FALSE)) {
  grantOption = false;
 } else {
  grantOption = null;
 }
 return new Builder().setComponent(tSentryPrivilege.getComponent())
                      .setService(tSentryPrivilege.getServiceName())
                      .setAuthorizables(toAuthorizables(tSentryPrivilege.getAuthorizables()))
                      .setAction(tSentryPrivilege.getAction())
                      .withGrantOption(grantOption)
                      .build();
}
origin: apache/sentry

private PrivilegeObject toPrivilegeObject(TSentryPrivilege tSentryPrivilege) {
 Boolean grantOption;
 if (tSentryPrivilege.getGrantOption().equals(TSentryGrantOption.TRUE)) {
  grantOption = true;
 } else if (tSentryPrivilege.getGrantOption().equals(TSentryGrantOption.FALSE)) {
  grantOption = false;
 } else {
  grantOption = null;
 }
 return new Builder().setComponent(tSentryPrivilege.getComponent())
                      .setService(tSentryPrivilege.getServiceName())
                      .setAuthorizables(toAuthorizables(tSentryPrivilege.getAuthorizables()))
                      .setAction(tSentryPrivilege.getAction())
                      .withGrantOption(grantOption)
                      .build();
}
org.apache.sentry.provider.db.generic.service.persistentPrivilegeObject$BuilderwithGrantOption

Popular methods of PrivilegeObject$Builder

  • <init>
  • build
  • setAction
  • setAuthorizables
  • setComponent
  • setService
  • toLowerAuthorizableName
    TolowerCase the authorizable name, the authorizable type is define when it was created. Take the Sol

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top PhpStorm plugins
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