Package org.bgerp.cache

# Class UserCache

java.lang.Object
org.bgerp.cache.Cache<UserCache>
org.bgerp.cache.UserCache

public class UserCache extends Cache<UserCache>

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final ConfigMap`
  `EMPTY_PERMISSION`
  `static final CacheHolder<UserCache>`
  `HOLDER`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UserCache()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `flush(Connection con)`
  `static Collection<User>`
  `getActiveUsers()`
  `static List<Group>`
  `getGroupPath(int id)`
  `static ConfigMap`
  `getPerm(int userId, String action)`
  Gets user permission for an action.
  `static User`
  `getUser(int id)`
  `static User`
  `getUser(String login)`
  Finds user with status not `User.STATUS_DISABLED`.
  `static Group`
  `getUserGroup(int groupId)`
  `static int`
  `getUserGroupChildCount(int groupId)`
  Deprecated.
  `static Set<Group>`
  `getUserGroupChildFullSet(int groupId)`
  `static Set<Group>`
  `getUserGroupChildSet(int groupId)`
  `static List<Group>`
  `getUserGroupFullTitledList()`
  `static Map<Integer,Group>`
  `getUserGroupFullTitledMap()`
  `static List<Group>`
  `getUserGroupList()`
  `static List<UserGroup>`
  `getUserGroupList(int id)`
  `static List<UserGroup>`
  `getUserGroupList(int id, int parentId, Date actualDate)`
  `static List<UserGroup>`
  `getUserGroupList(int id, Date actualDate)`
  `static Map<Integer,Group>`
  `getUserGroupMap()`
  `static List<IdStringTitle>`
  `getUserGroupRoleFullTitledList(int roleId)`
  Provides full list of groups with for a role with IDs concatenated from group ID and role ID.
  `static String`
  `getUserGroupWithPath(Map<Integer,Group> groupMap, int id, boolean withId)`
  "Возвращает полный путь к корневой группе в виде строки (например: Администратор -> Помощник -> Помощник помощника)"
  `static List<User>`
  `getUserList()`
  `static List<User>`
  `getUserList(Set<Integer> groupIds)`
  `static Map<Integer,User>`
  `getUserMap()`
  `static List<Permset>`
  `getUserPermsetList()`
  `static Map<Integer,Permset>`
  `getUserPermsetMap()`
  `protected UserCache`
  `newInstance()`
  Creates a new cache instance

  ### Methods inherited from class org.bgerp.cache.Cache

  `isValid`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### HOLDER

    public static final CacheHolder<UserCache> HOLDER

  - ### EMPTY_PERMISSION

    public static final ConfigMap EMPTY_PERMISSION

- ## Constructor Details

  - ### UserCache

    public UserCache()

- ## Method Details

  - ### getUser

    public static User getUser(int id)

  - ### getUserMap

    public static Map<Integer,User> getUserMap()

  - ### getUser

    public static User getUser(String login)
    Finds user with status not `User.STATUS_DISABLED`.
    Parameters:
      `login` -
    Returns:

  - ### getUserList

    public static List<User> getUserList()

  - ### getActiveUsers

    public static Collection<User> getActiveUsers()

  - ### getUserGroup

    public static Group getUserGroup(int groupId)

  - ### getUserGroupChildCount

    @Deprecated public static int getUserGroupChildCount(int groupId)
    Deprecated.

  - ### getPerm

    public static ConfigMap getPerm(int userId, String action)
    Gets user permission for an action.
    Parameters:
      `userId` - the user ID.
      `action` - semicolon separated action class name and method, e.g. `org.bgerp.plugin.bil.invoice.action.InvoiceAction:get`.
    Returns:
      allowed permission with options or `null`.

  - ### getUserList

    public static List<User> getUserList(Set<Integer> groupIds)

  - ### getUserGroupChildSet

    public static Set<Group> getUserGroupChildSet(int groupId)

  - ### getUserGroupChildFullSet

    public static Set<Group> getUserGroupChildFullSet(int groupId)

  - ### getUserGroupList

    public static List<Group> getUserGroupList()

  - ### getUserGroupFullTitledList

    public static List<Group> getUserGroupFullTitledList()

  - ### getUserGroupRoleFullTitledList

    public static List<IdStringTitle> getUserGroupRoleFullTitledList(int roleId)
    Provides full list of groups with for a role with IDs concatenated from group ID and role ID.
    Parameters:
      `roleId` -
    Returns:

  - ### getUserGroupMap

    public static Map<Integer,Group> getUserGroupMap()

  - ### getUserGroupFullTitledMap

    public static Map<Integer,Group> getUserGroupFullTitledMap()

  - ### getUserPermsetList

    public static List<Permset> getUserPermsetList()
    Returns:
      alphabetically sorted list with all permission sets.

  - ### getUserPermsetMap

    public static Map<Integer,Permset> getUserPermsetMap()
    Returns:
      map with all use permission sets, key - ID

  - ### flush

    public static void flush(Connection con)

  - ### getGroupPath

    public static List<Group> getGroupPath(int id)

  - ### getUserGroupWithPath

    public static String getUserGroupWithPath(Map<Integer,Group> groupMap, int id, boolean withId)
    "Возвращает полный путь к корневой группе в виде строки (например: Администратор -> Помощник -> Помощник помощника)"
    Parameters:
      `id` - группы
    Returns:
      Строка с полным путем к корневой группе, либо title группы, если нет родительской группы

  - ### getUserGroupList

    public static List<UserGroup> getUserGroupList(int id)

  - ### getUserGroupList

    public static List<UserGroup> getUserGroupList(int id, Date actualDate)

  - ### getUserGroupList

    public static List<UserGroup> getUserGroupList(int id, int parentId, Date actualDate)

  - ### newInstance

    protected UserCache newInstance()
    Description copied from class: `Cache`
    Creates a new cache instance
    Specified by:
      `newInstance` in class `Cache<UserCache>`
    Returns:
      the instance