Dandelion - API Documentation - Rights
Module name: groups
Index
getlist
Endpoint: /api/groups/getlist
Method: GET
Parameters: None
Description: Get list of group names and their IDs.
Example Return Data:
Returned Values:
- id (int) - ID of group, used to get the permissions with getgroup
- name (string) - Name of group
Permissions Needed:
- None
getgroup
Endpoint: /api/groups/getgroup
Method: GET
Parameters: groupid
Parameter | Type | Default | Required |
---|---|---|---|
groupid |
int | true |
Description: Get array of permissions for group
Example Return Data:
Returned Values:
- id (int) - ID of group, used to get the permissions with getgroup
- name (string) - Name of group
- permissions (array) - Keyed array of permission names and their values
- permissionNames (array) - Keyed array of human readable permission names keyed to their respecive permission
Permissions Needed:
- None
create
Endpoint: /api/groups/create
Method: POST
Parameters: name
, rights
Parameter | Type | Default | Required |
---|---|---|---|
name |
string | true | |
rights |
string | false |
Description: Create a new group named name
and assign it the permissions rights
. rights
is a stringified JSON object with the format as returned by the getuserrights endpoint. If rights
is omitted, the group is blank meaning it has no permission set to true by default.
Example Return Data:
Returned Values:
- data (string) - User displayable string if the creation was successful or not
Permissions Needed:
- Create group
edit
Endpoint: /api/groups/edit
Method: POST
Parameters: groupid
, rights
Parameter | Type | Default | Required |
---|---|---|---|
groupid |
int | true | |
rights |
string | true |
Description: Edit groupid
and assign it the permissions rights
. rights
is a stringified JSON object with the format as returned by the getuserrights endpoint.
Example Return Data:
Returned Values:
- data (string) - User displayable string if the save was successful or not
Permissions Needed:
- Edit group
delete
Endpoint: /api/groups/delete
Method: POST
Parameters: groupid
Parameter | Type | Default | Required |
---|---|---|---|
groupid |
int | true |
Description: Delete group groupid
Example Return Data:
Returned Values:
- data (string) - User displayable string if the delete was successful or not
Permissions Needed:
- Delete group
getuserrights
Endpoint: /api/groups/getuserrights
Method: GET
Parameters: None
Description: Get permissions for current user (user of key).
Example Return Data:
Returned Values:
- permissions (array) - Keyed array of permission names and their values
Permissions Needed:
- None
Full permission list:
- “createlog”: false
- “editlog”: false
- “viewlog”: true
- “createcat”: false
- “editcat”: false
- “deletecat”: false
- “createuser”: false
- “edituser”: false
- “deleteuser”: false
- “creategroup”: false
- “editgroup”: false
- “deletegroup”: false
- “viewcheesto”: true
- “updatecheesto”: false
- “admin”: false