Class PermissionHelper

java.lang.Object
org.codelibs.fess.helper.PermissionHelper

public class PermissionHelper extends Object
Helper class for handling permission-related operations in Fess. Provides functionality to encode/decode permission strings and extract role type information from various file system protocols (SMB, file, FTP).
  • Field Details

    • rolePrefix

      protected String rolePrefix
      Prefix used to identify role-based permissions
    • groupPrefix

      protected String groupPrefix
      Prefix used to identify group-based permissions
    • userPrefix

      protected String userPrefix
      Prefix used to identify user-based permissions
    • allowPrefix

      protected String allowPrefix
      Prefix used to identify allow permissions
    • denyPrefix

      protected String denyPrefix
      Prefix used to identify deny permissions
    • systemHelper

      protected SystemHelper systemHelper
      System helper for user/group/role search operations
  • Constructor Details

    • PermissionHelper

      public PermissionHelper()
      Default constructor for PermissionHelper. Initializes the permission helper with default configuration.
  • Method Details

    • encode

      public String encode(String value)
      Encodes a permission string into a search role format. Processes user, group, and role prefixes along with allow/deny prefixes.
      Parameters:
      value - the permission string to encode
      Returns:
      the encoded permission string, or null if the input is blank or invalid
    • decode

      public String decode(String value)
      Decodes a search role format string back to a permission string. Reverses the encoding process to restore original permission format.
      Parameters:
      value - the encoded permission string to decode
      Returns:
      the decoded permission string, or null if the input is blank or invalid
    • setRolePrefix

      public void setRolePrefix(String rolePrefix)
      Sets the prefix used to identify role-based permissions.
      Parameters:
      rolePrefix - the role prefix to set
    • setGroupPrefix

      public void setGroupPrefix(String groupPrefix)
      Sets the prefix used to identify group-based permissions.
      Parameters:
      groupPrefix - the group prefix to set
    • setUserPrefix

      public void setUserPrefix(String userPrefix)
      Sets the prefix used to identify user-based permissions.
      Parameters:
      userPrefix - the user prefix to set
    • getSmbRoleTypeList

      public List<String> getSmbRoleTypeList(org.codelibs.fess.crawler.entity.ResponseData responseData)
      Extracts role type information from SMB (Server Message Block) response data. Processes both SMB and SMB1 protocols to extract allowed and denied SIDs.
      Parameters:
      responseData - the response data containing SMB metadata
      Returns:
      a list of role type strings extracted from the SMB permissions
    • getFileRoleTypeList

      public List<String> getFileRoleTypeList(org.codelibs.fess.crawler.entity.ResponseData responseData)
      Extracts role type information from file system response data. Processes ACL (Access Control List) or POSIX file attributes to extract user and group information.
      Parameters:
      responseData - the response data containing file system metadata
      Returns:
      a list of role type strings extracted from the file permissions
    • getFtpRoleTypeList

      public List<String> getFtpRoleTypeList(org.codelibs.fess.crawler.entity.ResponseData responseData)
      Extracts role type information from FTP (File Transfer Protocol) response data. Processes FTP metadata to extract file owner and group information.
      Parameters:
      responseData - the response data containing FTP metadata
      Returns:
      a list of role type strings extracted from the FTP file permissions
    • setAllowPrefix

      public void setAllowPrefix(String allowPrefix)
      Sets the prefix used to identify allow permissions.
      Parameters:
      allowPrefix - the allow prefix to set
    • setDenyPrefix

      public void setDenyPrefix(String denyPrefix)
      Sets the prefix used to identify deny permissions.
      Parameters:
      denyPrefix - the deny prefix to set