Package edu.iu.uits.lms.canvas.services
Class AccountService
java.lang.Object
edu.iu.uits.lms.canvas.services.BaseService
edu.iu.uits.lms.canvas.services.SpringBaseService
edu.iu.uits.lms.canvas.services.AccountService
Service to get various account related things
-
Field Summary
Fields inherited from class edu.iu.uits.lms.canvas.services.SpringBaseService
canvasConfiguration, restTemplate, restTemplateNoBuffer
Fields inherited from class edu.iu.uits.lms.canvas.services.BaseService
READ_SCOPE, WRITE_SCOPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
elevateToAccountAdmin
(String accountId, String userId) Elevate the given user to an account admingetAccount
(String accountId) Get a specific account object from Canvas GET /api/v1/accounts/account_idgetAccountsForUser
(String userLoginId) Get all accounts a given user can accessGet all roles that are defined in the systemgetParentAccounts
(String accountId) getRolesForAccount
(String accountId, boolean showInherited) Get all the roles for the given accountIdGET /api/v1/accounts/:account_id/authentication_providers/:idgetSsoSettings
(String canvasServer) GET /api/v1/accounts/:account_id/sso_settingsGet all subaccounts that are defined in the systemboolean
isAccountAdmin
(String accountId, String userId) Is the given user an admin in the given accountboolean
revokeAsAccountAdmin
(String accountId, String userId) Demote the given user back to a "regular" user as they no longer need to ba an account adminvoid
PUT /api/v1/accounts/:account_id/authentication_providers/:idsetSisAccountId
(String accountId, String sisAccountId) Account with this accountId to use to set the sisAccountId valuesetSsoSettings
(String canvasServer, SsoSettingsWrapper ssoSettingsWrapper) PUT /api/v1/accounts/:account_id/sso_settingsMethods inherited from class edu.iu.uits.lms.canvas.services.SpringBaseService
doGet, doGetSingle
Methods inherited from class edu.iu.uits.lms.canvas.services.BaseService
buildAlternateId
-
Constructor Details
-
AccountService
public AccountService()
-
-
Method Details
-
getAllRoles
Get all roles that are defined in the system- Returns:
- List of CanvasRole objects
-
getRolesForAccount
Get all the roles for the given accountId- Parameters:
accountId
- Account idshowInherited
- Flag indicating if all inherited roles should be returned as well- Returns:
- List of canvas roles available to this account
-
getParentAccounts
@Cacheable(value="parentAccounts", cacheManager="CanvasServicesCacheManager") public List<Account> getParentAccounts(String accountId) - Parameters:
accountId
- Account id- Returns:
- a list of the parent
Account
s for the given accountId
-
getAccount
Get a specific account object from Canvas GET /api/v1/accounts/account_id- Parameters:
accountId
- Canvas account id. Could also have the form of sis_account_id:account_id- Returns:
- Account
-
getAccountsForUser
Get all accounts a given user can access- Parameters:
userLoginId
- User's login id- Returns:
- List of accessible accounts
-
isAccountAdmin
Is the given user an admin in the given account- Parameters:
accountId
-userId
-- Returns:
-
elevateToAccountAdmin
Elevate the given user to an account admin- Parameters:
accountId
-userId
-- Returns:
-
revokeAsAccountAdmin
Demote the given user back to a "regular" user as they no longer need to ba an account admin- Parameters:
accountId
-userId
-- Returns:
-
getSubAccounts
Get all subaccounts that are defined in the system- Returns:
- List of Account objects
-
setSisAccountId
Account with this accountId to use to set the sisAccountId value- Parameters:
accountId
- - the accountId to use to setsisAccountId
- - the sisAccountId value to set for account with accountId- Returns:
- - the account changed
-
getSsoSettings
GET /api/v1/accounts/:account_id/sso_settings- Parameters:
canvasServer
-- Returns:
-
setSsoSettings
PUT /api/v1/accounts/:account_id/sso_settings- Parameters:
canvasServer
-ssoSettingsWrapper
-- Returns:
-
getSaml
GET /api/v1/accounts/:account_id/authentication_providers/:id- Parameters:
canvasServer
-samlId
-- Returns:
-
setSaml
PUT /api/v1/accounts/:account_id/authentication_providers/:id- Parameters:
canvasServer
-samlId
-newSamlObject
-
-