Class UserCache


public class UserCache extends Cache<UserCache>
  • Field Details

  • 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

      public static int getUserGroupChildCount(int groupId)
    • 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