Package org.codelibs.fess.helper
Class PermissionHelper
java.lang.Object
org.codelibs.fess.helper.PermissionHelper
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 Summary
FieldsModifier and TypeFieldDescriptionprotected StringPrefix used to identify allow permissionsprotected StringPrefix used to identify deny permissionsprotected StringPrefix used to identify group-based permissionsprotected StringPrefix used to identify role-based permissionsprotected SystemHelperSystem helper for user/group/role search operationsprotected StringPrefix used to identify user-based permissions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecodes a search role format string back to a permission string.Encodes a permission string into a search role format.getFileRoleTypeList(org.codelibs.fess.crawler.entity.ResponseData responseData) Extracts role type information from file system response data.getFtpRoleTypeList(org.codelibs.fess.crawler.entity.ResponseData responseData) Extracts role type information from FTP (File Transfer Protocol) response data.getSmbRoleTypeList(org.codelibs.fess.crawler.entity.ResponseData responseData) Extracts role type information from SMB (Server Message Block) response data.voidsetAllowPrefix(String allowPrefix) Sets the prefix used to identify allow permissions.voidsetDenyPrefix(String denyPrefix) Sets the prefix used to identify deny permissions.voidsetGroupPrefix(String groupPrefix) Sets the prefix used to identify group-based permissions.voidsetRolePrefix(String rolePrefix) Sets the prefix used to identify role-based permissions.voidsetUserPrefix(String userPrefix) Sets the prefix used to identify user-based permissions.
-
Field Details
-
rolePrefix
Prefix used to identify role-based permissions -
groupPrefix
Prefix used to identify group-based permissions -
userPrefix
Prefix used to identify user-based permissions -
allowPrefix
Prefix used to identify allow permissions -
denyPrefix
Prefix used to identify deny permissions -
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
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
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
Sets the prefix used to identify role-based permissions.- Parameters:
rolePrefix- the role prefix to set
-
setGroupPrefix
Sets the prefix used to identify group-based permissions.- Parameters:
groupPrefix- the group prefix to set
-
setUserPrefix
Sets the prefix used to identify user-based permissions.- Parameters:
userPrefix- the user prefix to set
-
getSmbRoleTypeList
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
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
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
Sets the prefix used to identify allow permissions.- Parameters:
allowPrefix- the allow prefix to set
-
setDenyPrefix
Sets the prefix used to identify deny permissions.- Parameters:
denyPrefix- the deny prefix to set
-