Package org.artifactory.security
Interface Security
public interface Security
These are the usage of security data and logged in user methods.
- Author:
- Fred Simon
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.booleancanAnnotate(RepoPath repoPath) booleanbooleanbooleanbooleanDeprecated.UsegetCurrentUsername()insteadAccessible only if current user is an admin.String[]The group names for the current logged-in user.String[]Retrieves the groups of the current user according to the given realm settings Available realms areLdapGroupsSettingsandCrowdGroupsSettingsDeprecated.No need to escape a base58 passwordbooleanisAdmin()booleanbooleanbooleanbooleanvoidpopulateUserProperties(User user) Attaches all the user properties to the given uservoidupdateUser(User user) Update the user with the same username as the user.getUsername() passed.
NOTE: Only updatable fields will be updated.
The user object cannot be null, and user.getUsername() should represent an existing non-anonymous or system user.
-
Method Details
-
isUpdatableProfile
boolean isUpdatableProfile()- Returns:
- True if the current user can update her profile.
-
isAnonAccessEnabled
boolean isAnonAccessEnabled()- Returns:
- True if anonymous access is allowed.
-
canRead
- Returns:
- True if the current user can read the specified path.
-
canAnnotate
- Returns:
- True if the current user can annotate the specified path.
-
canDelete
- Returns:
- True if the current user can delete the specified path.
-
canDeploy
- Returns:
- True if the current user can deploy to the specified path.
-
canAdmin
Deprecated.Useinsteadinvalid reference
#canManage()- Returns:
- True if the current user has admin permissions on a target info that includes this path..
-
canManage
- Returns:
- True if the current user has manage permissions on a target info that includes this path..
-
getCurrentUsername
String getCurrentUsername()- Returns:
- The current logged-in user name.
- Since:
- 2.3.3
-
currentUsername
Deprecated.UsegetCurrentUsername()insteadThe current logged in-user name.- Returns:
- The current logged in-user name
-
getCurrentUserGroupNames
String[] getCurrentUserGroupNames()The group names for the current logged-in user.- Returns:
- A list of group names associated with the current user.
- Since:
- 2.3.3
-
getCurrentUserGroupNames
Retrieves the groups of the current user according to the given realm settings Available realms areLdapGroupsSettingsandCrowdGroupsSettings- Parameters:
settings- Realm specific settings- Returns:
- A list of group names associated with the current user with the relevant realm.
- Since:
- 4.1.0
-
isAdmin
boolean isAdmin()- Returns:
- True if the current is a system administrator.
-
isAnonymous
boolean isAnonymous()- Returns:
- True if the current user is a anonymous.
-
isAuthenticated
boolean isAuthenticated()- Returns:
- True if a user (anonymous and system are also users) is logged in.
-
getEncryptedPassword
String getEncryptedPassword()- Returns:
- The encrypted password of the current user
-
getEscapedEncryptedPassword
Deprecated.No need to escape a base58 passwordUsed in default settings.xml filtered resource file.- Returns:
- the encrypted password of the current user, no need for escaping anymore
-
currentUser
User currentUser()- Returns:
- The current logged in user, the anonymous user or null if no authentication details present.
-
findUser
Accessible only if current user is an admin.- Returns:
- The user with the given username if exists or null.
- Throws:
SecurityException- if the current user is not an admin user
-
populateUserProperties
Attaches all the user properties to the given user- Parameters:
user- The user to attach properties to
-
updateUser
Update the user with the same username as the user.getUsername() passed.
NOTE: Only updatable fields will be updated.
The user object cannot be null, and user.getUsername() should represent an existing non-anonymous or system user. Here are the fields that will be updated and the conditions:- user.getEmail() will be updated if not null
- user.isAdmin() will be updated
- user.isEnabled() will be updated
- user.isUpdatableProfile() will be updated
- user.getPrivateKey() will be updated if not null
- user.getPublicKey() will be updated if not null
- user.isTransientUser() will be updated
- user.getGroups() will be updated if not null and all group name exists
- user.getBintrayAuth() will be updated if not null
- Parameters:
user- the user with all the fields to update
-
invalid reference