Class PermissionCheckerWrapper

Object
com.liferay.portal.kernel.security.permission.wrapper.PermissionCheckerWrapper
All Implemented Interfaces:
PermissionChecker, Cloneable

public class PermissionCheckerWrapper extends Object implements PermissionChecker
Author:
Preston Crary
  • Constructor Details

    • PermissionCheckerWrapper

      public PermissionCheckerWrapper(PermissionChecker permissionChecker)
  • Method Details

    • clone

      public final PermissionChecker clone()
      Specified by:
      clone in interface PermissionChecker
      Overrides:
      clone in class Object
    • getCompanyId

      public long getCompanyId()
      Description copied from interface: PermissionChecker
      Returns the primary key of the user's company.
      Specified by:
      getCompanyId in interface PermissionChecker
      Returns:
      the primary key of the user's company
    • getGuestUserRoleIds

      public long[] getGuestUserRoleIds()
      Specified by:
      getGuestUserRoleIds in interface PermissionChecker
    • getOwnerRoleId

      public long getOwnerRoleId()
      Description copied from interface: PermissionChecker
      Returns the primary key of the owner role. This role is automatically given to the creator of a resource.
      Specified by:
      getOwnerRoleId in interface PermissionChecker
      Returns:
      the primary key of the owner role
    • getPermissionChecksMap

      public Map<Object,Object> getPermissionChecksMap()
      Specified by:
      getPermissionChecksMap in interface PermissionChecker
    • getRoleIds

      public long[] getRoleIds(long userId, long groupId)
      Description copied from interface: PermissionChecker
      Returns the primary keys of the roles the user has within the group.
      Specified by:
      getRoleIds in interface PermissionChecker
      Parameters:
      userId - the primary key of the user
      groupId - the primary key of the group
      Returns:
      the primary keys of the roles the user has within the group
    • getUser

      public User getUser()
      Specified by:
      getUser in interface PermissionChecker
    • getUserBag

      public UserBag getUserBag() throws Exception
      Specified by:
      getUserBag in interface PermissionChecker
      Throws:
      Exception
    • getUserId

      public long getUserId()
      Description copied from interface: PermissionChecker
      Returns the primary key of the user.
      Specified by:
      getUserId in interface PermissionChecker
      Returns:
      the primary key of the user
    • hasOwnerPermission

      public boolean hasOwnerPermission(long companyId, String name, long primKey, long ownerId, String actionId)
      Description copied from interface: PermissionChecker
      Returns true if the user is the owner of the resource and has permission to perform the action.
      Specified by:
      hasOwnerPermission in interface PermissionChecker
      Parameters:
      companyId - the primary key of the user's company
      name - the resource's name, which can be either a class name or a portlet ID
      primKey - the primary key of the resource
      ownerId - the primary key of the resource's owner
      actionId - the action ID
      Returns:
      true if the user is the owner of the resource and has permission to perform the action; false otherwise
    • hasOwnerPermission

      public boolean hasOwnerPermission(long companyId, String name, String primKey, long ownerId, String actionId)
      Description copied from interface: PermissionChecker
      Returns true if the user is the owner of the resource and has permission to perform the action.
      Specified by:
      hasOwnerPermission in interface PermissionChecker
      Parameters:
      companyId - the primary key of the user's company
      name - the resource's name, which can be either a class name or a portlet ID
      primKey - the primary key of the resource
      ownerId - the primary key of the resource's owner
      actionId - the action ID
      Returns:
      true if the user is the owner of the resource and has permission to perform the action; false otherwise
    • hasPermission

      public boolean hasPermission(Group group, String name, long primKey, String actionId)
      Specified by:
      hasPermission in interface PermissionChecker
    • hasPermission

      public boolean hasPermission(Group group, String name, String primKey, String actionId)
      Specified by:
      hasPermission in interface PermissionChecker
    • hasPermission

      public boolean hasPermission(long groupId, String name, long primKey, String actionId)
      Description copied from interface: PermissionChecker
      Returns true if the user has permission to perform the action on the resource.
      Specified by:
      hasPermission in interface PermissionChecker
      Parameters:
      groupId - the primary key of the group containing the resource
      name - the resource's name, which can be either a class name or a portlet ID
      primKey - the primary key of the resource
      actionId - the action ID
      Returns:
      true if the user has permission to perform the action on the resource; false otherwise
    • hasPermission

      public boolean hasPermission(long groupId, String name, String primKey, String actionId)
      Description copied from interface: PermissionChecker
      Returns true if the user has permission to perform the action on the resource.
      Specified by:
      hasPermission in interface PermissionChecker
      Parameters:
      groupId - the primary key of the group containing the resource
      name - the resource's name, which can be either a class name or a portlet ID
      primKey - the primary key of the resource
      actionId - the action ID
      Returns:
      true if the user has permission to perform the action on the resource; false otherwise
    • init

      public final void init(User user)
      Description copied from interface: PermissionChecker
      Initializes this permission checker.
      Specified by:
      init in interface PermissionChecker
      Parameters:
      user - the current user
    • init

      public final void init(User user, RoleContributor[] roleContributors)
      Specified by:
      init in interface PermissionChecker
    • isCheckGuest

      public boolean isCheckGuest()
      Description copied from interface: PermissionChecker
      Returns true if guest permissions will be used in permission checks.
      Specified by:
      isCheckGuest in interface PermissionChecker
      Returns:
      true if guest permissions will be used in permission checks; false otherwise
    • isCompanyAdmin

      public boolean isCompanyAdmin()
      Description copied from interface: PermissionChecker
      Returns true if the user is an administrator of their company.
      Specified by:
      isCompanyAdmin in interface PermissionChecker
      Returns:
      true if the user is an administrator of their company; false otherwise
    • isCompanyAdmin

      public boolean isCompanyAdmin(long companyId)
      Description copied from interface: PermissionChecker
      Returns true if the user is an administrator of the company.
      Specified by:
      isCompanyAdmin in interface PermissionChecker
      Parameters:
      companyId - the primary key of the company
      Returns:
      true if the user is an administrator of the company; false otherwise
    • isContentReviewer

      public boolean isContentReviewer(long companyId, long groupId)
      Description copied from interface: PermissionChecker
      Returns true if the user is a content reviewer or has sufficient permissions to review content (i.e. the user is a company or group administrator).
      Specified by:
      isContentReviewer in interface PermissionChecker
      Parameters:
      companyId - the primary key of the company
      groupId - the primary key of the group
      Returns:
      true if the user is a reviewer or has sufficient permissions to review content; false otherwise
    • isGroupAdmin

      public boolean isGroupAdmin(long groupId)
      Description copied from interface: PermissionChecker
      Returns true if the user is an administrator of the group.
      Specified by:
      isGroupAdmin in interface PermissionChecker
      Parameters:
      groupId - the primary key of the group
      Returns:
      true if the user is an administrator of the group; false otherwise
    • isGroupMember

      public boolean isGroupMember(long groupId)
      Description copied from interface: PermissionChecker
      Returns true if the user is a member of the group.
      Specified by:
      isGroupMember in interface PermissionChecker
      Parameters:
      groupId - the primary key of the group
      Returns:
      true if the user is a member of the group; false otherwise
    • isGroupOwner

      public boolean isGroupOwner(long groupId)
      Description copied from interface: PermissionChecker
      Returns true if the user is the owner of the group.
      Specified by:
      isGroupOwner in interface PermissionChecker
      Parameters:
      groupId - the primary key of the group
      Returns:
      true if the user is the owner of the group; false otherwise
    • isOmniadmin

      public boolean isOmniadmin()
      Description copied from interface: PermissionChecker
      Returns true if the user is a universal administrator.
      Specified by:
      isOmniadmin in interface PermissionChecker
      Returns:
      true if the user is a universal administrator; false otherwise
      See Also:
      • OmniadminUtil
    • isOrganizationAdmin

      public boolean isOrganizationAdmin(long organizationId)
      Description copied from interface: PermissionChecker
      Returns true if the user is an administrator of the organization.
      Specified by:
      isOrganizationAdmin in interface PermissionChecker
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      true if the user is an administrator of the organization; false otherwise
    • isOrganizationOwner

      public boolean isOrganizationOwner(long organizationId)
      Description copied from interface: PermissionChecker
      Returns true if the user is an owner of the organization.
      Specified by:
      isOrganizationOwner in interface PermissionChecker
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      true if the user is an owner of the organization; false otherwise
    • isSignedIn

      public boolean isSignedIn()
      Description copied from interface: PermissionChecker
      Returns true if the user is signed in.
      Specified by:
      isSignedIn in interface PermissionChecker
      Returns:
      true if the user is signed in; false otherwise