Class UserRoleTable

    • Constructor Detail

      • UserRoleTable

        public UserRoleTable()
    • Method Detail

      • getUserRole

        public UserRoleRow getUserRole​(int id)
                                throws SQLException
        Returns the UserRole whith the given id.
        Parameters:
        id -
        Returns:
        the UserRole whith the given id.
        Throws:
        SQLException
      • getUserRole

        public UserRoleRow getUserRole​(int instanceId,
                                       String roleName,
                                       int inherited)
                                throws SQLException
        Returns the UserRole with the given roleName in the given instance.
        Parameters:
        instanceId -
        roleName -
        Returns:
        the UserRole with the given roleName in the given instance. the UserRole whith the given roleName in the given instance.
        Throws:
        SQLException
      • getAllUserRolesOfInstance

        public UserRoleRow[] getAllUserRolesOfInstance​(int instanceId)
                                                throws SQLException
        Returns all the UserRoles of an instance.
        Parameters:
        instanceId -
        Returns:
        all the UserRoles of an instance.
        Throws:
        SQLException
      • getAllUserRoleIdsOfInstance

        public String[] getAllUserRoleIdsOfInstance​(int instanceId)
                                             throws SQLException
        Returns all the UserRole ids of an instance.
        Parameters:
        instanceId -
        Returns:
        all the UserRole ids of an instance.
        Throws:
        SQLException
      • getAllUserRoleIdsOfObject

        public String[] getAllUserRoleIdsOfObject​(int objectId,
                                                  String objectType,
                                                  int instanceId)
                                           throws SQLException
        Returns all the UserRole ids of an object in a given instance.
        Parameters:
        objectId -
        objectType -
        instanceId -
        Returns:
        all the UserRole ids of an object in a given instance.
        Throws:
        SQLException
      • getDirectUserRolesOfUser

        public UserRoleRow[] getDirectUserRolesOfUser​(int userId)
                                               throws SQLException
        Returns all the direct UserRoles of user.
        Parameters:
        userId -
        Returns:
        all the direct UserRoles of user.
        Throws:
        SQLException
      • getDirectUserRolesOfGroup

        public UserRoleRow[] getDirectUserRolesOfGroup​(int groupId)
                                                throws SQLException
        Returns all the direct UserRoles of a group.
        Parameters:
        groupId -
        Returns:
        all the direct UserRoles of a group.
        Throws:
        SQLException
      • createUserRole

        public void createUserRole​(UserRoleRow userRole)
                            throws SQLException
        Inserts in the database a new userRole row.
        Parameters:
        userRole -
        Throws:
        SQLException
      • removeUserRole

        public void removeUserRole​(int id)
                            throws SQLException
        Delete the userRole
        Parameters:
        id -
        Throws:
        SQLException
      • addUserInUserRole

        public void addUserInUserRole​(int userId,
                                      int userRoleId)
                               throws SQLException
        Add an user in a userRole.
        Parameters:
        userId -
        userRoleId -
        Throws:
        SQLException
        AdminException
      • removeUserFromUserRole

        public void removeUserFromUserRole​(int userId,
                                           int userRoleId)
                                    throws SQLException
        Removes an user from a userRole.
        Parameters:
        userId -
        userRoleId -
        Throws:
        SQLException
      • removeAllUsersFromUserRole

        public void removeAllUsersFromUserRole​(int userRoleId)
                                        throws SQLException
        Removes all users from a userRole.
        Parameters:
        userRoleId -
        Throws:
        SQLException
      • removeAllGroupsFromUserRole

        public void removeAllGroupsFromUserRole​(int userRoleId)
                                         throws SQLException
        Removes all groups from a userRole.
        Parameters:
        userRoleId -
        Throws:
        SQLException
      • addGroupInUserRole

        public void addGroupInUserRole​(int groupId,
                                       int userRoleId)
                                throws SQLException
        Adds a group in a userRole.
        Parameters:
        groupId -
        userRoleId -
        Throws:
        SQLException
      • removeGroupFromUserRole

        public void removeGroupFromUserRole​(int groupId,
                                            int userRoleId)
                                     throws SQLException
        Removes a group from a userRole.
        Parameters:
        groupId -
        userRoleId -
        Throws:
        SQLException