Class UserAclPlugin

java.lang.Object
io.meeds.social.user.plugin.UserAclPlugin
All Implemented Interfaces:
io.meeds.portal.plugin.AclPlugin

@Component public class UserAclPlugin extends Object implements io.meeds.portal.plugin.AclPlugin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from interface io.meeds.portal.plugin.AclPlugin

    DELETE_PERMISSION_TYPE, EDIT_PERMISSION_TYPE, VIEW_PERMISSION_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<String>
    getGuestVisibleGroupIds(org.exoplatform.services.security.Identity identity)
    The groups through which a guest sees other users under the VIEW rule of this plugin: the space groups of their UserACL identity, memberships inherited through a nested-group link included.
     
    boolean
    hasPermission(String objectId, String permissionType, org.exoplatform.services.security.Identity identity)
    The VIEW rule, checked in this order: an administrator; the target themself; a shared group, only a space group for a guest viewer (isGuest(Identity)) and any group but SpaceUtils.PLATFORM_EXTERNALS_GROUP for any other viewer; a confirmed connection, read last so that a viewer sharing a group with the target causes no relationship read.
    void
     
    static boolean
    isGuest(org.exoplatform.services.security.Identity identity)
    Whether a viewer is a guest: their UserACL identity holds a membership of SpaceUtils.PLATFORM_EXTERNALS_GROUP.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • UserAclPlugin

      public UserAclPlugin()
  • Method Details

    • init

      @PostConstruct public void init()
    • getObjectType

      public String getObjectType()
      Specified by:
      getObjectType in interface io.meeds.portal.plugin.AclPlugin
    • isGuest

      public static boolean isGuest(org.exoplatform.services.security.Identity identity)
      Whether a viewer is a guest: their UserACL identity holds a membership of SpaceUtils.PLATFORM_EXTERNALS_GROUP. The membership is the authority, not the profile's external property derived from a direct membership only.
      Parameters:
      identity - the viewer's UserACL identity, may be null
      Returns:
      true for a guest
    • getGuestVisibleGroupIds

      public static List<String> getGuestVisibleGroupIds(org.exoplatform.services.security.Identity identity)
      The groups through which a guest sees other users under the VIEW rule of this plugin: the space groups of their UserACL identity, memberships inherited through a nested-group link included. The People Directory builds its guest restriction from this set, so that the directory and the profile pages apply one rule.
      Parameters:
      identity - the guest's UserACL identity, may be null
      Returns:
      the space group ids, never null
    • hasPermission

      public boolean hasPermission(String objectId, String permissionType, org.exoplatform.services.security.Identity identity)
      The VIEW rule, checked in this order: an administrator; the target themself; a shared group, only a space group for a guest viewer (isGuest(Identity)) and any group but SpaceUtils.PLATFORM_EXTERNALS_GROUP for any other viewer; a confirmed connection, read last so that a viewer sharing a group with the target causes no relationship read.
      Specified by:
      hasPermission in interface io.meeds.portal.plugin.AclPlugin