public interface AccountService
Modifier and Type | Method and Description |
---|---|
Account |
create(AccountInput input)
Creates a built-in account
|
Account |
create(AccountInput input,
java.lang.String authenticationSourceMode)
Creates an account and allows for further customisation
|
AccountGroup |
createGroup(NameDescription nameDescription)
Creation of an account group
|
Ack |
deleteAccount(ID accountId)
Deletes an account
|
Ack |
deleteGlobalPermission(PermissionTargetType type,
int id)
Deletes a permission
|
Ack |
deleteGroup(ID groupId)
Deleting a group.
|
Ack |
deleteProjectPermission(ID projectId,
PermissionTargetType type,
int id)
Deletes a project permission.
|
java.util.Collection<AccountGroup> |
findAccountGroupsByGlobalRole(GlobalRole globalRole)
List of groups having the given global role
|
java.util.Collection<AccountGroup> |
findAccountGroupsByProjectRole(Project project,
ProjectRole projectRole)
List of groups having the given project role
|
java.util.Collection<Account> |
findAccountsByGlobalRole(GlobalRole globalRole)
List of accounts having the given global role
|
java.util.Collection<Account> |
findAccountsByProjectRole(Project project,
ProjectRole projectRole)
List of accounts having the given project role
|
java.util.Optional<Account> |
findUserByNameAndSource(java.lang.String username,
AuthenticationSourceProvider sourceProvider)
Looks for an account using its user name and his authentication source.
|
Account |
getAccount(ID accountId)
Gets an account using its ID
|
AccountGroup |
getAccountGroup(ID groupId)
Getting a group
|
java.util.List<AccountGroup> |
getAccountGroups()
List of account groups
|
java.util.List<AccountGroupSelection> |
getAccountGroupsForSelection(ID accountId)
Returns the list of all account groups, together with the status for their selection
in the given account ID.
|
java.util.List<Account> |
getAccounts()
List of accounts
|
java.util.List<Account> |
getAccountsForGroup(AccountGroup accountGroup)
Gets the list of accounts associated with this account group.
|
java.util.Collection<GlobalPermission> |
getGlobalPermissions()
Gets the list of global permissions.
|
java.util.Optional<GlobalRole> |
getGlobalRoleForAccount(Account account)
Gets the optional global role for an account
|
java.util.Optional<GlobalRole> |
getGlobalRoleForAccountGroup(AccountGroup group)
Gets the optional global role for an account group.
|
java.util.Collection<ProjectPermission> |
getProjectPermissions(ID projectId)
Gets the list of permissions for a project.
|
java.util.Collection<ProjectRoleAssociation> |
getProjectPermissionsForAccount(Account account)
Gets the list of project permissions for a given account
|
java.util.Collection<ProjectRoleAssociation> |
getProjectPermissionsForAccountGroup(AccountGroup group)
Gets the list of project permissions for a given account group
|
Ack |
saveGlobalPermission(PermissionTargetType type,
int id,
PermissionInput input)
|
Ack |
saveProjectPermission(ID projectId,
PermissionTargetType type,
int id,
PermissionInput input)
|
java.util.Collection<PermissionTarget> |
searchPermissionTargets(java.lang.String token)
Searches for a list of permission targets using the
token as a part in the
name of the permission target. |
Account |
updateAccount(ID accountId,
AccountInput input)
Updating an existing account
|
AccountGroup |
updateGroup(ID groupId,
NameDescription input)
Updating a group
|
Account |
withACL(AuthenticatedAccount raw)
Completes an account with the list of its authorisations.
|
Account withACL(AuthenticatedAccount raw)
raw
- Account without authorisationsjava.util.List<Account> getAccounts()
Account create(AccountInput input)
Account create(AccountInput input, java.lang.String authenticationSourceMode)
input
- Account dataauthenticationSourceMode
- Authentication modeAuthenticationSourceService.getAuthenticationSource(String)
java.util.Optional<Account> findUserByNameAndSource(java.lang.String username, AuthenticationSourceProvider sourceProvider)
username
- User namesourceProvider
- Provider of the sourceAccount updateAccount(ID accountId, AccountInput input)
accountId
- ID of the account to updateinput
- Update datajava.util.List<AccountGroup> getAccountGroups()
AccountGroup createGroup(NameDescription nameDescription)
AccountGroup getAccountGroup(ID groupId)
AccountGroup updateGroup(ID groupId, NameDescription input)
java.util.List<AccountGroupSelection> getAccountGroupsForSelection(ID accountId)
set
,
meaning that none of the groups will be selected.accountId
- Account ID to get the groups for, or not set
java.util.Collection<PermissionTarget> searchPermissionTargets(java.lang.String token)
token
as a part in the
name of the permission target.Ack saveGlobalPermission(PermissionTargetType type, int id, PermissionInput input)
java.util.Collection<GlobalPermission> getGlobalPermissions()
Ack deleteGlobalPermission(PermissionTargetType type, int id)
java.util.Collection<ProjectPermission> getProjectPermissions(ID projectId)
projectId
- ID of the projectAck saveProjectPermission(ID projectId, PermissionTargetType type, int id, PermissionInput input)
Ack deleteProjectPermission(ID projectId, PermissionTargetType type, int id)
java.util.Collection<ProjectRoleAssociation> getProjectPermissionsForAccount(Account account)
account
- Account to get the permissions forjava.util.Optional<GlobalRole> getGlobalRoleForAccount(Account account)
account
- Accountjava.util.List<Account> getAccountsForGroup(AccountGroup accountGroup)
accountGroup
- Account groupjava.util.Optional<GlobalRole> getGlobalRoleForAccountGroup(AccountGroup group)
group
- Account groupjava.util.Collection<ProjectRoleAssociation> getProjectPermissionsForAccountGroup(AccountGroup group)
group
- Account group to get the permissions forjava.util.Collection<AccountGroup> findAccountGroupsByGlobalRole(GlobalRole globalRole)
globalRole
- Global role to search forjava.util.Collection<Account> findAccountsByGlobalRole(GlobalRole globalRole)
globalRole
- Global role to search forjava.util.Collection<AccountGroup> findAccountGroupsByProjectRole(Project project, ProjectRole projectRole)
project
- ProjectprojectRole
- Role to search forjava.util.Collection<Account> findAccountsByProjectRole(Project project, ProjectRole projectRole)
project
- ProjectprojectRole
- Role to search for