Adding default flag to the group domain object so that the client can select a default permission group for the user.
This commit is contained in:
parent
045f1f31d7
commit
b8bc4514ba
|
|
@ -30,6 +30,8 @@ public class Group extends BaseDomain {
|
||||||
*/
|
*/
|
||||||
Set<String> permissions;
|
Set<String> permissions;
|
||||||
|
|
||||||
|
private Boolean isDefault = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the display name is null or empty, then just return the actual group name. This is just to ensure that
|
* If the display name is null or empty, then just return the actual group name. This is just to ensure that
|
||||||
* the client is never sent an empty group name for displaying on the UI.
|
* the client is never sent an empty group name for displaying on the UI.
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ public class GroupServiceImpl extends BaseService<GroupRepository, Group, String
|
||||||
newGroup.setDisplayName(group.getDisplayName());
|
newGroup.setDisplayName(group.getDisplayName());
|
||||||
newGroup.setOrganizationId(organizationId);
|
newGroup.setOrganizationId(organizationId);
|
||||||
newGroup.setPermissions(group.getPermissions());
|
newGroup.setPermissions(group.getPermissions());
|
||||||
|
newGroup.setIsDefault(group.getIsDefault());
|
||||||
log.debug("Creating group {} for org: {}", group.getName(), organizationId);
|
log.debug("Creating group {} for org: {}", group.getName(), organizationId);
|
||||||
return create(newGroup);
|
return create(newGroup);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@ let res = [
|
||||||
"_id": ObjectId("5da151714a020300041ae8ff"),
|
"_id": ObjectId("5da151714a020300041ae8ff"),
|
||||||
"name": "org-admin",
|
"name": "org-admin",
|
||||||
"organizationId": "5da151714a020300041ae8fd",
|
"organizationId": "5da151714a020300041ae8fd",
|
||||||
|
"displayName": "Org Admin Group",
|
||||||
|
"isDefault": true,
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"read:groups",
|
"read:groups",
|
||||||
"read:organizations",
|
"read:organizations",
|
||||||
|
|
@ -78,7 +80,42 @@ let res = [
|
||||||
],
|
],
|
||||||
"deleted": false,
|
"deleted": false,
|
||||||
"_class": "com.appsmith.server.domains.Group"
|
"_class": "com.appsmith.server.domains.Group"
|
||||||
}),
|
},
|
||||||
|
{
|
||||||
|
"_id": ObjectId("5df8c1e0078d501fc3f4491b"),
|
||||||
|
"name": "org-admin",
|
||||||
|
"organizationId": "default-org",
|
||||||
|
"displayName": "Org Admin Group",
|
||||||
|
"isDefault": true,
|
||||||
|
"permissions": [
|
||||||
|
"read:groups",
|
||||||
|
"read:organizations",
|
||||||
|
"create:users",
|
||||||
|
"create:groups",
|
||||||
|
"create:organizations",
|
||||||
|
"read:users",
|
||||||
|
"read:pages",
|
||||||
|
"create:pages",
|
||||||
|
"update:pages",
|
||||||
|
"read:layouts",
|
||||||
|
"create:layouts",
|
||||||
|
"update:layouts",
|
||||||
|
"read:properties",
|
||||||
|
"create:properties",
|
||||||
|
"update:properties",
|
||||||
|
"read:actions",
|
||||||
|
"create:actions",
|
||||||
|
"update:actions",
|
||||||
|
"read:resources",
|
||||||
|
"create:resources",
|
||||||
|
"update:resources",
|
||||||
|
"read:plugins",
|
||||||
|
"create:plugins",
|
||||||
|
"update:plugins"
|
||||||
|
],
|
||||||
|
"deleted": false,
|
||||||
|
"_class": "com.appsmith.server.domains.Group"
|
||||||
|
}),
|
||||||
|
|
||||||
db.user.insert({
|
db.user.insert({
|
||||||
"name": "Admin User",
|
"name": "Admin User",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user