com.ibm.openpages.api.service

## Interface ISecurityService

-     public interface ISecurityService

       Interface for the security service that provides access to the OpenPages security model.
       Use SecurityService to perform create or delete operations on IUser and IGroup Objects.
       Use SecuirtyService to retrieve RoleTemplates or ApplicationPermissions and assign role(s) to IUser.
       Use SecuirtyService to retrieve IPasswordPolicy.

  See Also:
    `GroupInfo`, `IGroup`, `UserInfo`, `IRoleTemplate`, `IFolder`, `IRoleAssignment`, `IApplicationPermission`, `IPasswordPolicy`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `anonymizeUser(Id userId, java.lang.String anonymizedText)` Anonymize the specified user attributes from OpenPages security system.
    `void` | `assignRole(IGroup group, IRoleTemplate roleTemplate, IFolder folder)` Assigns role to specified group for the given folder.
    `void` | `assignRole(IUser user, IRoleTemplate roleTemplate, IFolder folder)` Assigns role to specified user for the given folder.
    `void` | `assignRoles(IGroup group, java.util.List<IRoleTemplate> roleTemplates, java.util.List<IFolder> folders)` Assigns each of the roles in the roleTemplates list to specified group in each of the folders.
    `void` | `assignRoles(IUser user, java.util.List<IRoleTemplate> roleTemplates, java.util.List<IFolder> folders)` Assigns each of the roles in the roleTemplates list to a specified user in each of the folders.
    `IGroup` | `createGroup(GroupInfo groupInfo)` Creates new security group based on provided group specification.
    `IGroup` | `createGroup(GroupInfo groupInfo, IGroup parentGroup)` Creates new security group based on provided group specification and parent group.
    `IUser` | `createUser(UserInfo userInfo, java.util.List<IGroup> groups)` Creates user based on provided specification and a list of groups for membership assignment.
    `void` | `deleteGroups(java.util.List<IGroup> groups)` Deletes specified groups from OpenPages security system.
    `void` | `deleteUsers(java.util.List<IUser> users)` Deletes specified users from OpenPages security system.
    `java.util.Iterator<IGroup>` | `getAccessibleGroups()` Retrieves all groups accessible by current user.
    `java.util.List<Id>` | `getActorImpersonates(Id actorId)` Find all actors, users or groups, that the given actor impersonates.
    `java.util.List<IAdminPermission>` | `getAdminPermissions(java.util.List<Id> groupIds, java.util.List<Id> administratorIds)` Finds administrator permissions for provided list of group ids and list of administrator ids.
    `IApplicationPermission` | `getApplicationPermission(Id id)` Retrieves application permission by Id.
    `IApplicationPermission` | `getApplicationPermission(java.lang.String name)` Retrieves application permission by name.
    `java.util.List<IApplicationPermission>` | `getApplicationPermissions()` Retrieves all the application permissions
    `IPasswordPolicy` | `getCurrentPasswordPolicy()` Retrieves current OpenPages password policy.
    `IUser` | `getCurrentUser()` Returns the currently logged in user.
    `IGroup` | `getGroup(Id groupId)` Retrieves group by Id.
    `IGroup` | `getGroup(Id groupId, GroupOptions options)` Retrieves group by Id.
    `IGroup` | `getGroup(java.lang.String groupName)` Retrieves group by name.
    `IGroup` | `getGroup(java.lang.String groupName, GroupOptions options)` Retrieves group by name.
    `java.util.Iterator<IGroup>` | `getGroups(boolean includeActiveGroupsOnly)` Retrieves groups from the OpenPages security system.
    `IRoleAssignment` | `getRoleAssignment(Id id)` Returns the role assignment corresponding to the specified Id.
    `java.util.Iterator<IRoleAssignment>` | `getRoleAssignments()` Returns an iterator over all role assignments effective in the system.
    `java.util.Iterator<IRoleAssignment>` | `getRoleAssignments(ISecurityPrincipal userOrGroup, IRoleTemplate roleTemplate, IFolder folder)` Returns an iterator over all role assignments effective in the user or group
    `IRoleTemplate` | `getRoleTemplate(Id id)` Retrieves role template by Id.
    `IRoleTemplate` | `getRoleTemplate(java.lang.String name)` Retrieves role template by name.
    `java.util.Iterator<IRoleTemplate>` | `getRoleTemplates(boolean includesLockedTemplates, boolean includesDisabledTemplates)` Retrieves role templates based on the specified criteria.
    `java.util.Iterator<IGroup>` | `getTopLevelGroups()` Retrieves top level security groups from the OpenPages security model.
    `IUser` | `getUser(Id userId)` Retrieves user by Id.
    `IUser` | `getUser(java.lang.String userName)` Retrieves user information by name.
    `java.util.Iterator<IUser>` | `getUsers(boolean includeActiveusersOnly)` Retrieves users from the OpenPages security system.
    `boolean` | `hasPermission(IApplicationPermission applicationPermission)` Verifies if current user has application permission.
    `boolean` | `isSecurityAdministrator()` Verifies if the current user is a security administrator.
    `boolean` | `isSuperAdministrator(IUser user)` Checks whether the user is a system designated Super Administrator.
    `boolean` | `isUser(Id id)` Check if the id represents an IUser instance

- - ### Method Detail

    - #### isSecurityAdministrator

          boolean isSecurityAdministrator()

      Verifies if the current user is a security administrator.
      Returns:
        boolean - true, if the user has at least one administrative access on any group. - false, if the user does not have administrative access on any group.

    - #### createGroup

          IGroup createGroup(GroupInfo groupInfo)

      Creates new security group based on provided group specification. By default group is created under "standalone users and groups" when no parent group is specified.
      Parameters:
        `groupInfo` - (required) GroupInfo
      Returns:
        IGroup

    - #### createGroup

          IGroup createGroup(GroupInfo groupInfo,
                             IGroup parentGroup)

      Creates new security group based on provided group specification and parent group.
      Parameters:
        `groupInfo` - (required) GroupInfo
        `parentGroup` - (required) parentGroup
      Returns:
        IGroup

    - #### createUser

          IUser createUser(UserInfo userInfo,
                           java.util.List<IGroup> groups)

      Creates user based on provided specification and a list of groups for membership assignment.
      Parameters:
        `userInfo` - (required) UserInfo
        `groups` - (required) list of groups
      Returns:
        IUser

    - #### deleteUsers

          void deleteUsers(java.util.List<IUser> users)

      Deletes specified users from OpenPages security system.
      Parameters:
        `users` - (required) list of users

    - #### anonymizeUser

          void anonymizeUser(Id userId,
                             java.lang.String anonymizedText)

      Anonymize the specified user attributes from OpenPages security system.

           The anonymized text is "Anonymous", if it is not specified.
           The first name, last name and description of the user will be the anonymized text.
           The middle name of the user will be empty.
           The email address of the user will be "{anonymizedText}@{anonymizedText:lowercase}.com", e.g. "Anonymous@anonymous.com".

      Note: please make sure that the given user's activity in the system has terminated/quiesced before anonymizing them.

      Permissions:

      The operation can only be performed by a super user.

      Parameters:
        `userId` - (required) the user id
        `anonymizedText` - (optional) the anonymized text, default "Anonymous", the maximum length of the value is 64.

    - #### deleteGroups

          void deleteGroups(java.util.List<IGroup> groups)

      Deletes specified groups from OpenPages security system.
      Parameters:
        `groups` - (required) list of groups

    - #### getGroups

          java.util.Iterator<IGroup> getGroups(boolean includeActiveGroupsOnly)

      Retrieves groups from the OpenPages security system.
      Parameters:
        `includeActiveGroupsOnly` -
      Returns:
        Iterator

    - #### getUsers

          java.util.Iterator<IUser> getUsers(boolean includeActiveusersOnly)

      Retrieves users from the OpenPages security system.
      Parameters:
        `includeActiveusersOnly` -
      Returns:
        Iterator

    - #### getGroup

          IGroup getGroup(Id groupId)

      Retrieves group by Id.
      Parameters:
        `groupId` - (required) Id of the group
      Returns:
        IGroup if a valid group exists; otherwise null

    - #### getGroup

          IGroup getGroup(Id groupId,
                          GroupOptions options)

      Retrieves group by Id.
      Parameters:
        `groupId` - (required) Id of the group
        `options` - (required) specifies the data to be retrieved. The default behavior retrieves all group members.
      Returns:
        IGroup if a valid group exists; otherwise null

    - #### getGroup

          IGroup getGroup(java.lang.String groupName)

      Retrieves group by name.
      Parameters:
        `groupName` - (required) name of the group
      Returns:
        IGroup if a valid group exists; otherwise null

    - #### getGroup

          IGroup getGroup(java.lang.String groupName,
                          GroupOptions options)

      Retrieves group by name.
      Parameters:
        `groupName` - (required) name of the group
        `options` - (required) specifies the data to be retrieved. The default behavior retrieves all group members.
      Returns:
        IGroup if a valid group exists; otherwise null

    - #### getUser

          IUser getUser(Id userId)

      Retrieves user by Id.
      Parameters:
        `userId` - (required)
      Returns:
        IUser if a valid user exists; otherwise null

    - #### getUser

          IUser getUser(java.lang.String userName)

      Retrieves user information by name.
      Parameters:
        `userName` - (required)
      Returns:
        IUser if a valid user exists; otherwise null

    - #### getTopLevelGroups

          java.util.Iterator<IGroup> getTopLevelGroups()

      Retrieves top level security groups from the OpenPages security model.
      Returns:
        Iterator

    - #### assignRoles

          void assignRoles(IUser user,
                           java.util.List<IRoleTemplate> roleTemplates,
                           java.util.List<IFolder> folders)

      Assigns each of the roles in the roleTemplates list to a specified user in each of the folders.
      Parameters:
        `user` - (required) IUser object
        `roleTemplates` - (required) list of IRoleTemplate
        `folders` - (required) list of IFolder

    - #### assignRole

          void assignRole(IUser user,
                          IRoleTemplate roleTemplate,
                          IFolder folder)

      Assigns role to specified user for the given folder.
      Parameters:
        `user` - (required) IUser object
        `roleTemplate` - (required) IRoleTemplate
        `folder` - (required) IFolder

    - #### assignRoles

          void assignRoles(IGroup group,
                           java.util.List<IRoleTemplate> roleTemplates,
                           java.util.List<IFolder> folders)

      Assigns each of the roles in the roleTemplates list to specified group in each of the folders.
      Parameters:
        `user` - (required) IGroup object
        `roleTemplates` - (required) list of IRoleTemplate
        `folders` - (required) list of IFolder

    - #### assignRole

          void assignRole(IGroup group,
                          IRoleTemplate roleTemplate,
                          IFolder folder)

      Assigns role to specified group for the given folder.
      Parameters:
        `user` - (required) An IGroup object
        `roleTemplate` - (required) IRoleTemplate
        `folder` - (required) IFolder

    - #### getRoleTemplates

          java.util.Iterator<IRoleTemplate> getRoleTemplates(boolean includesLockedTemplates,
                                                             boolean includesDisabledTemplates)

      Retrieves role templates based on the specified criteria.
      Parameters:
        `includesLcokedTemplates` -
        `includesDisabledTemplates` -
      Returns:
        Iterator

    - #### getRoleTemplate

          IRoleTemplate getRoleTemplate(Id id)

      Retrieves role template by Id.
      Parameters:
        `id` - (required) RoleTemplate Id
      Returns:
        IRoleTemplate

    - #### getRoleTemplate

          IRoleTemplate getRoleTemplate(java.lang.String name)

      Retrieves role template by name.
      Parameters:
        `name` - (required)
      Returns:
        IRoleTemplate

    - #### getCurrentPasswordPolicy

          IPasswordPolicy getCurrentPasswordPolicy()

      Retrieves current OpenPages password policy.
      Returns:
        IPasswordPolicy

    - #### getAccessibleGroups

          java.util.Iterator<IGroup> getAccessibleGroups()

      Retrieves all groups accessible by current user.
      Returns:
        Iterator

    - #### getApplicationPermission

          IApplicationPermission getApplicationPermission(Id id)

      Retrieves application permission by Id.
      Parameters:
        `id` - (required) ApplicationPermission Id
      Returns:
        IApplicationPermission

    - #### getApplicationPermission

          IApplicationPermission getApplicationPermission(java.lang.String name)

      Retrieves application permission by name. Below are some examples of the application permission names. All All/Administration All/Administration/Archive Management All/Collaboration All/Collaboration/JobTypes All/Files All/Files/Folders All/Workflow All/Publication All/Users and Groups
      Parameters:
        `name` - (required) name of the ApplicationPermission
      Returns:
        IApplicationPermission

    - #### getApplicationPermissions

          java.util.List<IApplicationPermission> getApplicationPermissions()

      Retrieves all the application permissions
      Returns:
        List

    - #### hasPermission

          boolean hasPermission(IApplicationPermission applicationPermission)

      Verifies if current user has application permission.
      Parameters:
        `applicationPermission` - (required)
      Returns:
        true if the user has permission

    - #### getRoleAssignments

          java.util.Iterator<IRoleAssignment> getRoleAssignments()

      Returns an iterator over all role assignments effective in the system.
      Returns:
        Iterator

    - #### getRoleAssignments

          java.util.Iterator<IRoleAssignment> getRoleAssignments(ISecurityPrincipal userOrGroup,
                                                                 IRoleTemplate roleTemplate,
                                                                 IFolder folder)

      Returns an iterator over all role assignments effective in the user or group
      Returns:
        Iterator

    - #### getRoleAssignment

          IRoleAssignment getRoleAssignment(Id id)

      Returns the role assignment corresponding to the specified Id.
      Parameters:
        `id` - (required) RoleAssignment Id
      Returns:
        IRoleAssignment

    - #### getCurrentUser

          IUser getCurrentUser()

      Returns the currently logged in user.
      Returns:
        IUser

    - #### getAdminPermissions

          java.util.List<IAdminPermission> getAdminPermissions(java.util.List<Id> groupIds,
                                                               java.util.List<Id> administratorIds)

      Finds administrator permissions for provided list of group ids and list of administrator ids.
      Parameters:
        `groupIds` - the list of securable group ids
        `administratorIds` - the list of administrator ids
      Returns:
        List the list of administrators

    - #### isUser

          boolean isUser(Id id)

      Check if the id represents an IUser instance
      Parameters:
        `id` - the Id for the SecurityPrincipal, which may be either an user or group
      Returns:
        true if the Id represents a user

    - #### isSuperAdministrator

          boolean isSuperAdministrator(IUser user)

      Checks whether the user is a system designated Super Administrator. The Super Administrator (specified during the install or upgrade process) is a user who has complete access to all objects, folders, Role Templates, and groups in the system. By default the super user will be the OpenPagesAdministrator on most systems.

      For more information on super administrators see the About Administrators section in the IBM OpenPages with Watson Administrators Guide
      Parameters:
        `user` - user to check for super administrator status
      Returns:
        true if the user is a super administrator

    - #### getActorImpersonates

          java.util.List<Id> getActorImpersonates(Id actorId)

      Find all actors, users or groups, that the given actor impersonates.

      Actors impersonate from direct and indirect group memberships and role assignments (represented through internal System created groups). From a folder-based security perspective, a user inherits all the permissions for all the groups it impersonates.

      Parameters:
        `actorId` - the Id of the actor to get what actors it impersonates
      Returns:
        the list of Ids for actors the given actor impersonates

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.