public class UserManager extends BaseManager
| Modifier and Type | Method and Description |
|---|---|
static DataResult |
activeInOrg(User user,
PageControl pc)
Retrieve the list of all active users in the specified user's org
|
static DataResult<UserOverview> |
activeInOrg2(User user)
Retrieve the list of all active users in the specified user's org
|
static void |
addChannelPerm(User user,
java.lang.Long cid,
java.lang.String role)
Adds channel permissions from a user.
|
static void |
addRemoveUserRoles(User usr,
java.util.List<java.lang.String> rolesToAdd,
java.util.List<java.lang.String> rolesToRemove)
Add and remove the specified roles from the user.
|
static boolean |
canAdministerSystemGroup(User user,
ManagedServerGroup group)
can a system group be administered by user?
|
static DataResult |
channelManagement(User user,
PageControl pc)
Retrieve the list of Channels the user can manage
|
static DataResult |
channelSubscriptions(User user,
PageControl pc)
Retrieve the list of Channels the user can subscribe to
|
static User |
createUser(User user,
Org org,
Address addr)
Create brand new personal user using the information found in the
User object.
|
static void |
deleteUser(User loggedInUser,
java.lang.Long targetUid)
Deletes a User
|
static DataResult |
disabledInOrg(User user,
PageControl pc)
Retrieve the list of all disabled users in the specified user's org
|
static void |
disableUser(User disabledBy,
User userToDisable)
Disables userToDisable.
|
static void |
enableUser(User enabledBy,
User userToEnable)
Enables a user.
|
static User |
findResponsibleUser(Org org,
Role r)
Returns the responsible user (the first orgadmin in the org)
|
static java.util.Set |
getDefaultSystemGroupIds(User usr)
Get the set of default system groups for this user
|
static RhnTimeZone |
getDefaultTimeZone()
Gets the default timezone object
|
static DataResult |
getSystemGroups(User user,
PageControl pc)
Returns the System Groups associated with the given User
bounded by the values of the PageControl.
|
static RhnTimeZone |
getTimeZone(int id)
Gets a timezone object based on id
|
static RhnTimeZone |
getTimeZone(java.lang.String olsonName)
Gets a timezone object based on olson name
|
static void |
grantServerGroupPermission(java.lang.Long uid,
long sgid)
Grants the given User permission to the ServerGroup whose id is sgid.
|
static void |
grantServerGroupPermission(User usr,
long sgid)
Grants the given User permission to the ServerGroup whose id is sgid.
|
static boolean |
hasRole(java.lang.Long uid,
Role label)
Check role for the specified user.
|
static java.util.Set<Role> |
listRolesAssignableBy(User user)
Returns a list of roles that are assignable by a given user
i.e.
|
static User |
loginReadOnlyUser(java.lang.String username,
java.lang.String password)
This method should be ONLY called when we need to authenticate read-only user
e.g.
|
static User |
loginUser(java.lang.String username,
java.lang.String password)
Login the user with the given username and password.
|
static java.util.List |
lookupAllTimeZones()
Gets all timezone objects in the appropriate order
|
static User |
lookupUser(User user,
java.lang.Long uid)
Retrieve the specified user, assuming that the User making the request
has the required permissions.
|
static User |
lookupUser(User user,
java.lang.String login)
Retrieve the specified user, assuming that the User making the request
has the required permissions.
|
static boolean |
lookupUserServerPreferenceValue(User user,
Server server,
java.lang.String preferenceName)
Looks up the value of a user's server preference.
|
static void |
removeChannelPerm(User user,
java.lang.Long cid,
java.lang.String role)
Removes channel permissions from a user or nothing if they already have
no channel permissions.
|
static void |
resetTemporaryRoles(User userIn,
java.util.Set<Role> temporaryRolesIn)
set temporary roles to the current set
|
static void |
revokeServerGroupPermission(java.lang.Long uid,
long sgid)
Revokes permission from the given User to the ServerGroup whose id is sgid.
|
static void |
revokeServerGroupPermission(User usr,
long sgid)
Revokes permission from the given User to the ServerGroup whose id is sgid.
|
static java.lang.String |
roleNames(java.util.Set<Role> rolesIn)
serialize role names
|
static boolean |
satelliteHasUsers()
Method to determine whether a satellite has any users.
|
static java.lang.String |
serverGroupsName(java.util.Set<ServerGroup> serverGroupsIn)
serialize role names
|
static void |
setDefaultSystemGroupIds(User usr,
java.util.Set groups)
Set the defaultSystemGroups for the specified User.
|
static void |
setUserServerPreferenceValue(User user,
Server server,
java.lang.String preferenceName,
boolean value)
Sets a UserServerPreference to true or false
|
static void |
storeUser(User user)
Updates the Users to the database
|
static java.util.List<User> |
usersInOrg(User user)
Retrieve the list of all users in the specified user's org.
|
static DataResult<UserOverview> |
usersInOrg(User user,
PageControl pc)
Retrieve the list of all users in the specified user's org.
|
static DataResult |
usersInOrg(User user,
PageControl pc,
java.lang.Class clazz)
Retrieve the list of all users in the specified user's org.
|
static DataResult |
usersInSet(User user,
java.lang.String label,
PageControl pc)
Returns the users in the given set
|
static boolean |
verifyChannelAdmin(java.lang.Long userId,
Channel channel)
Verifies that the passed in user id has admin over the passed in channel.
|
static boolean |
verifyChannelAdmin(User user,
Channel channel)
Verifies that the passed in user has admin over the passed in channel.
|
static boolean |
verifyChannelSubscribable(User user,
Channel channel)
Verifies that the passed in user has subscribe access to passed in channel.
|
static boolean |
verifyPackageAccess(Org org,
java.lang.Long packageId)
Verifies that a given org has access to a given package.
|
static DataResult |
visibleSystems(User user)
Generic visibleSystems that returns all systems visible to a
particular user.
|
static DataResult |
visibleSystems(User user,
PageControl pc)
Retrieve the list of systems visible to a particular user
|
static DataResult<SystemSearchResult> |
visibleSystemsAsDtoFromList(User user,
java.util.List<java.lang.Long> ids)
Returns visible Systems as a SystemSearchResult Object
|
makeDataResult, makeDataResult, makeDataResult, makeDataResult, makeDataResultNoPagination, makeDataResultNoPagination, processListControl, processPageControlpublic static java.util.Set<Role> listRolesAssignableBy(User user)
user - the user for whom the check is being donepublic static boolean verifyPackageAccess(Org org, java.lang.Long packageId)
org - The org in questionpackageId - The id of the package in questionpublic static boolean verifyChannelAdmin(User user, Channel channel)
user - The user to check.channel - The channel to check.public static boolean verifyChannelAdmin(java.lang.Long userId,
Channel channel)
userId - The user id to check.channel - The channel to check.public static boolean verifyChannelSubscribable(User user, Channel channel)
user - The user to check.channel - The channel to check.public static void enableUser(User enabledBy, User userToEnable)
enabledBy - The user doing the enablinguserToEnable - The user to enablepublic static void disableUser(User disabledBy, User userToDisable)
disabledBy - The user doing the disablinguserToDisable - The user to disablepublic static void revokeServerGroupPermission(java.lang.Long uid,
long sgid)
uid - Id of user who no longer needs permissionsgid - ServerGroup IDpublic static void revokeServerGroupPermission(User usr, long sgid)
usr - User who no longer needs permissionsgid - ServerGroup IDpublic static void grantServerGroupPermission(java.lang.Long uid,
long sgid)
uid - Id of user who needs permissionsgid - ServerGroup IDpublic static void grantServerGroupPermission(User usr, long sgid)
usr - User who needs permissionsgid - ServerGroup IDpublic static void addRemoveUserRoles(User usr, java.util.List<java.lang.String> rolesToAdd, java.util.List<java.lang.String> rolesToRemove)
usr - The User who's Roles you want to updaterolesToAdd - List of role labels to add.rolesToRemove - List of role labels to remove.public static User createUser(User user, Org org, Address addr)
user - Filled out user to create.org - Org to associate with the user.addr - Address to associate with the user.public static java.util.Set getDefaultSystemGroupIds(User usr)
usr - User for which to get the default system groups.public static void setDefaultSystemGroupIds(User usr, java.util.Set groups)
usr - User for which to set the default groups.groups - Set of groups to associate with the user.public static User loginUser(java.lang.String username, java.lang.String password) throws javax.security.auth.login.LoginException
username - User's login namepassword - User's unencrypted password.javax.security.auth.login.LoginException - if login fails. The message is a string resource key.public static User loginReadOnlyUser(java.lang.String username, java.lang.String password) throws javax.security.auth.login.LoginException
username - User's login namepassword - User's unencrypted password.javax.security.auth.login.LoginException - if login fails. The message is a string resource key.public static void storeUser(User user)
user - User to store.public static void deleteUser(User loggedInUser, java.lang.Long targetUid)
loggedInUser - The user doing the deletingtargetUid - The id for the user we're deletingpublic static User lookupUser(User user, java.lang.Long uid)
user - The user making the lookup request.uid - The id of the user to lookup.LookupException - if the User
can't be looked up.public static boolean hasRole(java.lang.Long uid,
Role label)
uid - The id of the user to lookup.label - Role to check.public static User lookupUser(User user, java.lang.String login)
user - The user making the lookup requestlogin - The login of the user to lookup.public static java.util.List<User> usersInOrg(User user)
user - The user who's org to search for users.public static DataResult<UserOverview> usersInOrg(User user, PageControl pc)
user - The user who's org to search for users.pc - The details of which results to return.public static DataResult usersInOrg(User user, PageControl pc, java.lang.Class clazz)
user - The user who's org to search for users.pc - The details of which results to return.clazz - The class you want the returned DataResult to contain.public static DataResult activeInOrg(User user, PageControl pc)
user - The user who's org to search for users.pc - The details of which results to return.public static DataResult<UserOverview> activeInOrg2(User user)
user - The user who's org to search for users.public static DataResult disabledInOrg(User user, PageControl pc)
user - The user who's org to search for users.pc - The details of which results to return.public static DataResult channelSubscriptions(User user, PageControl pc)
user - The user who's channels to search for.pc - The details of which results to return.public static DataResult channelManagement(User user, PageControl pc)
user - The user who's channels to search for.pc - The details of which results to return.public static DataResult visibleSystems(User user, PageControl pc)
user - The user in questionpc - The details of which results to returnpublic static DataResult visibleSystems(User user)
user - The user in questionpublic static DataResult<SystemSearchResult> visibleSystemsAsDtoFromList(User user, java.util.List<java.lang.Long> ids)
user - the user we wantids - the list of desired system idspublic static DataResult usersInSet(User user, java.lang.String label, PageControl pc)
user - The userlabel - The name of the setpc - Page Controlpublic static boolean canAdministerSystemGroup(User user, ManagedServerGroup group)
user - Usergroup - SystemGrouppublic static DataResult getSystemGroups(User user, PageControl pc)
user - User whose SystemGroups are sought.pc - Bounding PageControlpublic static RhnTimeZone getTimeZone(int id)
id - timezone id numberpublic static RhnTimeZone getTimeZone(java.lang.String olsonName)
olsonName - timezone olson namepublic static RhnTimeZone getDefaultTimeZone()
public static java.util.List lookupAllTimeZones()
public static void removeChannelPerm(User user, java.lang.Long cid, java.lang.String role)
user - The user for which the perm is changingcid - The channel identifierrole - The role the user is losing for this channel.public static void addChannelPerm(User user, java.lang.Long cid, java.lang.String role)
user - The user for which the perm is changingcid - The channel identifierrole - The role the user is gaining for this channel.public static boolean satelliteHasUsers()
public static User findResponsibleUser(Org org, Role r)
org - Org to searchr - Org_admin roleRoleFactory.ORG_ADMINpublic static boolean lookupUserServerPreferenceValue(User user, Server server, java.lang.String preferenceName)
user - user to lookup the preferenceserver - server that the preference corresponds topreferenceName - the name of the preferenceUserServerPreferenceIdpublic static void setUserServerPreferenceValue(User user, Server server, java.lang.String preferenceName, boolean value)
user - User whose preference will be setserver - Server we are setting the perference onpreferenceName - the name of the preferencevalue - true if the preference should be true, false otherwiseUserServerPreferenceIdpublic static void resetTemporaryRoles(User userIn, java.util.Set<Role> temporaryRolesIn)
userIn - affected usertemporaryRolesIn - temporary roles setpublic static java.lang.String roleNames(java.util.Set<Role> rolesIn)
rolesIn - roles to put into stringpublic static java.lang.String serverGroupsName(java.util.Set<ServerGroup> serverGroupsIn)
serverGroupsIn - roles to put into string