Skip to content

Commit

Permalink
Merge pull request #64 from buckett/additional-role-attributes
Browse files Browse the repository at this point in the history
Add workflow_state and is_account_role fields
  • Loading branch information
buckett authored Nov 10, 2023
2 parents 093becd + d0edbec commit 55db6eb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/edu/ksu/canvas/model/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class Role extends BaseCanvasModel implements Serializable {
private long id;
private String label;
private String baseRoleType;
private boolean isAccountRole;
private String workflowState;

public long getId() {
return id;
Expand All @@ -34,4 +36,20 @@ public String getBaseRoleType() {
public void setBaseRoleType(String baseRoleType) {
this.baseRoleType = baseRoleType;
}

public boolean isAccountRole() {
return isAccountRole;
}

public void setAccountRole(boolean accountRole) {
isAccountRole = accountRole;
}

public String getWorkflowState() {
return workflowState;
}

public void setWorkflowState(String workflowState) {
this.workflowState = workflowState;
}
}
7 changes: 7 additions & 0 deletions src/test/java/edu/ksu/canvas/tests/roles/RolesUTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ public void testListRoles() throws Exception {
List<Role> rolesList = roleReader.listRoles(options);
Assert.assertNotNull(rolesList);
Assert.assertEquals(1, rolesList.size());
Role role = rolesList.iterator().next();
Assert.assertEquals(1, role.getId());
Assert.assertEquals("Account Admin", role.getLabel());
Assert.assertEquals("AccountMembership", role.getBaseRoleType());
Assert.assertEquals(true, role.isAccountRole());
Assert.assertEquals("built_in", role.getWorkflowState());

}

}
1 change: 1 addition & 0 deletions src/test/resources/SampleJson/role/Role.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"label": "Account Admin",
"base_role_type": "AccountMembership",
"workflow_state": "built_in",
"is_account_role": true,
"permissions": {
"view_analytics": {
"enabled": true,
Expand Down

0 comments on commit 55db6eb

Please sign in to comment.