de.esprit.netsuite.server.perm

## Class DefaultPermissionManager<S extends ServerContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<S>
    - - de.esprit.netsuite.server.AbstractServerObject<S>
      - - de.esprit.netsuite.server.perm.DefaultPermissionManager<S>

- All Implemented Interfaces:
    ApplicationObject<S>, SimpleLogSupport, Dumpable, PermissionControlled, PermissionManager<S>, ServerObject<S>

      public class DefaultPermissionManager<S extends ServerContext>
      extends AbstractServerObject<S>
      implements PermissionManager<S>

  This class manages permissions for user and group access control in the esprit server.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPermissionManager(S serverCtx)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkPermission(SessionId sessionId, PermissionControlled obj, UserPermission action)`
    `void` | `checkPermission(UserId userId, PermissionControlled obj, UserPermission action)` Delegates to `PermissionConfig.checkUserPermission(UserId, PermissionControlled, UserPermission)`
    `ServerPermissionConfig` | `getPermissionConfig()` Returns a `PermissionConfig` instance which may be transferred to a client for editing.
    `PermissionDefinition` | `getSupportedPermissions()` Returns an object that identifies a `PermissionControlled` object with a unique name and provides a list of supported assignable permissions.
    `boolean` | `hasPermission(UserId userId, PermissionControlled obj, UserPermission action)` Delegates to `PermissionConfig`
    `void` | `init()`
    `void` | `save(SessionId sessionId)`
    `void` | `setPermissionConfig(SessionId sessionId, PermissionConfig permissionCfg)`

    - ### Methods inherited from class de.esprit.netsuite.server.AbstractServerObject

      `checkPermission, getServerConfig, getServerContext, getServerParams, getServerStartup, getStatisticManager, toString`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString`

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

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

    - ### Methods inherited from interface de.esprit.netsuite.server.ServerObject

      `getServerContext`

- - ### Constructor Detail

    - #### DefaultPermissionManager

          public DefaultPermissionManager(S serverCtx)

  - ### Method Detail

    - #### getSupportedPermissions

          public PermissionDefinition getSupportedPermissions()

      Description copied from interface: `PermissionControlled`
      Returns an object that identifies a `PermissionControlled` object with a unique name and provides a list of supported assignable permissions.
      Specified by:
        `getSupportedPermissions` in interface `PermissionControlled`

    - #### getPermissionConfig

          public final ServerPermissionConfig getPermissionConfig()

      Description copied from interface: `PermissionManager`
      Returns a `PermissionConfig` instance which may be transferred to a client for editing.
      Specified by:
        `getPermissionConfig` in interface `PermissionManager<S extends ServerContext>`
      See Also:
        `PermissionManager.setPermissionConfig(SessionId, PermissionConfig)`

    - #### setPermissionConfig

          public final void setPermissionConfig(SessionId sessionId,
                                 PermissionConfig permissionCfg)
                                         throws PermissionException

      Specified by:
        `setPermissionConfig` in interface `PermissionManager<S extends ServerContext>`
      Throws:
        `PermissionException`

    - #### init

          public void init()
                    throws java.lang.Exception

      Specified by:
        `init` in interface `PermissionManager<S extends ServerContext>`
      Throws:
        `java.lang.Exception`

    - #### save

          public void save(SessionId sessionId)
                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### hasPermission

          public boolean hasPermission(UserId userId,
                              PermissionControlled obj,
                              UserPermission action)

      Description copied from interface: `PermissionManager`
      Delegates to `PermissionConfig`
      Specified by:
        `hasPermission` in interface `PermissionManager<S extends ServerContext>`

    - #### checkPermission

          public void checkPermission(UserId userId,
                             PermissionControlled obj,
                             UserPermission action)
                               throws PermissionException

      Description copied from interface: `PermissionManager`
      Delegates to `PermissionConfig.checkUserPermission(UserId, PermissionControlled, UserPermission)`
      Specified by:
        `checkPermission` in interface `PermissionManager<S extends ServerContext>`
      Throws:
        `PermissionException`

    - #### checkPermission

          public void checkPermission(SessionId sessionId,
                             PermissionControlled obj,
                             UserPermission action)
                               throws PermissionException

      Specified by:
        `checkPermission` in interface `PermissionManager<S extends ServerContext>`
      Throws:
        `PermissionException`

Copyright © 2013 EsprIT-Systems. All Rights Reserved.