org.apache.ignite.internal.processors.security

## Class GridSecurityContext

- java.lang.Object
- - org.apache.ignite.internal.processors.security.GridSecurityContext

All Implemented Interfaces:
  Externalizable, Serializable

    public class GridSecurityContext
    extends Object
    implements Externalizable

Security context.

See Also:
  Serialized Form

### Field Summary

Fields
`static String` `VISOR_CACHE_CLEAR_TASK_NAME` Cache clear task name.
`static String` `VISOR_CACHE_LOAD_TASK_NAME` Cache load task name.
`static String` `VISOR_CACHE_QUERY_TASK_NAME` Cache query task name.

### Constructor Summary

Constructors
Constructor and Description
`GridSecurityContext()` Empty constructor required by `Externalizable`.
`GridSecurityContext(GridSecuritySubject subj)`

### Method Summary

Methods
`boolean` `cacheOperationAllowed(String cacheName, GridSecurityPermission perm)` Checks whether cache operation is allowed.
`void` `readExternal(ObjectInput in)`
`GridSecuritySubject` `subject()`
`boolean` `systemOperationAllowed(GridSecurityPermission perm)` Checks whether system-wide permission is allowed (excluding Visor task operations).
`boolean` `taskOperationAllowed(String taskClsName, GridSecurityPermission perm)` Checks whether task operation is allowed.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

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

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

### Field Detail

#### VISOR_CACHE_QUERY_TASK_NAME

    public static final String VISOR_CACHE_QUERY_TASK_NAME

Cache query task name.

See Also:
  Constant Field Values

#### VISOR_CACHE_LOAD_TASK_NAME

    public static final String VISOR_CACHE_LOAD_TASK_NAME

Cache load task name.

See Also:
  Constant Field Values

#### VISOR_CACHE_CLEAR_TASK_NAME

    public static final String VISOR_CACHE_CLEAR_TASK_NAME

Cache clear task name.

See Also:
  Constant Field Values

### Constructor Detail

#### GridSecurityContext

    public GridSecurityContext()

Empty constructor required by `Externalizable`.

#### GridSecurityContext

    public GridSecurityContext(GridSecuritySubject subj)

Parameters:
  `subj` - Subject.

### Method Detail

#### subject

    public GridSecuritySubject subject()

Returns:
  Security subject.

#### taskOperationAllowed

    public boolean taskOperationAllowed(String taskClsName,
                               GridSecurityPermission perm)

Checks whether task operation is allowed.

Parameters:
  `taskClsName` - Task class name.
  `perm` - Permission to check.
Returns:
  `True` if task operation is allowed.

#### cacheOperationAllowed

    public boolean cacheOperationAllowed(String cacheName,
                                GridSecurityPermission perm)

Checks whether cache operation is allowed.

Parameters:
  `cacheName` - Cache name.
  `perm` - Permission to check.
Returns:
  `True` if cache operation is allowed.

#### systemOperationAllowed

    public boolean systemOperationAllowed(GridSecurityPermission perm)

Checks whether system-wide permission is allowed (excluding Visor task operations).

Parameters:
  `perm` - Permission to check.
Returns:
  `True` if system operation is allowed.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015