View Javadoc
1   /*
2    * Copyright 2012-2025 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.entity;
17  
18  import java.io.Serializable;
19  
20  /**
21   * Interface representing a Fess user with authentication and authorization information.
22   * Provides access to user name, roles, groups, and permissions.
23   */
24  public interface FessUser extends Serializable {
25  
26      /**
27       * Gets the user's display name.
28       * @return The user's name.
29       */
30      String getName();
31  
32      /**
33       * Gets the user's assigned role names.
34       * @return Array of role names.
35       */
36      String[] getRoleNames();
37  
38      /**
39       * Gets the user's assigned group names.
40       * @return Array of group names.
41       */
42      String[] getGroupNames();
43  
44      /**
45       * Gets the user's permissions.
46       * @return Array of permission strings.
47       */
48      String[] getPermissions();
49  
50      /**
51       * Determines if the user's information can be edited.
52       * @return True if the user's information is editable, false otherwise.
53       */
54      default boolean isEditable() {
55          return false;
56      }
57  
58      /**
59       * Refreshes the user's information from the underlying data source.
60       * @return True if refresh was successful, false otherwise.
61       */
62      default boolean refresh() {
63          return false;
64      }
65  }