org.apache.ignite.plugin.security

## Class SecurityPermissionSetBuilder

- java.lang.Object
- - org.apache.ignite.plugin.security.SecurityPermissionSetBuilder

    public class SecurityPermissionSetBuilder
    extends Object

Provides a convenient way to create a permission set.

Here is example:

          SecurityPermissionSet permsSet = new SecurityPermissionSetBuilder()
              .appendCachePermissions("cache1", CACHE_PUT, CACHE_REMOVE)
              .appendCachePermissions("cache2", CACHE_READ)
              .appendTaskPermissions("task1", TASK_CANCEL)
              .appendTaskPermissions("task2", TASK_EXECUTE)
              .appendSystemPermissions(ADMIN_VIEW, EVENTS_ENABLE)
              .build();

The builder also does additional validation. For example, if you try to append `EVENTS_ENABLE` permission for a cache, exception will be thrown:

          SecurityPermissionSet permsSet = new SecurityPermissionSetBuilder()
              .appendCachePermissions("cache1", EVENTS_ENABLE)
              .build();

### Constructor Summary

Constructors
Constructor and Description
`SecurityPermissionSetBuilder()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`SecurityPermissionSetBuilder` `appendCachePermissions(String name, SecurityPermission... perms)` Append permission set form `cache` with `name`.
`SecurityPermissionSetBuilder` `appendServicePermissions(String name, SecurityPermission... perms)` Append permission set form `service` with `name`.
`SecurityPermissionSetBuilder` `appendSystemPermissions(SecurityPermission... perms)` Append system permission set.
`SecurityPermissionSetBuilder` `appendTaskPermissions(String name, SecurityPermission... perms)` Append permission set form `task` with `name`.
`SecurityPermissionSet` `build()` Builds the `SecurityPermissionSet`.
`static SecurityPermissionSetBuilder` `create()` Static factory method for create new permission builder.
`SecurityPermissionSetBuilder` `defaultAllowAll(boolean dfltAllowAll)` Append default all flag.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SecurityPermissionSetBuilder

    public SecurityPermissionSetBuilder()

### Method Detail

#### create

    public static SecurityPermissionSetBuilder create()

Static factory method for create new permission builder.

Returns:
  SecurityPermissionSetBuilder

#### defaultAllowAll

    public SecurityPermissionSetBuilder defaultAllowAll(boolean dfltAllowAll)

Append default all flag.

Parameters:
  `dfltAllowAll` - Default allow all.
Returns:
  SecurityPermissionSetBuilder refer to same permission builder.

#### appendTaskPermissions

    public SecurityPermissionSetBuilder appendTaskPermissions(String name,
                                                              SecurityPermission... perms)

Append permission set form `task` with `name`.

Parameters:
  `name` - String for map some task to permission set.
  `perms` - Permissions.
Returns:
  SecurityPermissionSetBuilder refer to same permission builder.

#### appendServicePermissions

    public SecurityPermissionSetBuilder appendServicePermissions(String name,
                                                                 SecurityPermission... perms)

Append permission set form `service` with `name`.

Parameters:
  `name` - String for map some service to permission set.
  `perms` - Permissions.
Returns:
  SecurityPermissionSetBuilder refer to same permission builder.

#### appendCachePermissions

    public SecurityPermissionSetBuilder appendCachePermissions(String name,
                                                               SecurityPermission... perms)

Append permission set form `cache` with `name`.

Parameters:
  `name` - String for map some cache to permission set.
  `perms` - Permissions.
Returns:
  `SecurityPermissionSetBuilder` refer to same permission builder.

#### appendSystemPermissions

    public SecurityPermissionSetBuilder appendSystemPermissions(SecurityPermission... perms)

Append system permission set.

Parameters:
  `perms` - Permission.
Returns:
  `SecurityPermissionSetBuilder` refer to same permission builder.

#### build

    public SecurityPermissionSet build()

Builds the `SecurityPermissionSet`.

Returns:
  `SecurityPermissionSet` instance.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018