Zurück zur Übersicht » REST - Role

REST - Role

REST-Interface

Get role by id

URL
GET <application-url>/api/role/<roleId>

Path parameter

Produces

application/json
application/xml

com.matterial.mtr.api.object.Role

Permission
Login

Sample
GET http://localhost:8080/mtr-backend/api/role/7


Get roles

URL
GET <application-url>/api/role

Query parameter

Produces

application/json
application/xml

com.matterial.mtr.api.object.ListResult<Role>

Permission
Login

Sample
GET http://localhost:8080/mtr-backend/api/role?count=true


Create role

URL
POST <application-url>/api/role

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Role

Produces

application/json
application/xml

com.matterial.mtr.api.object.Role (id only)

Permission
EDIT_ROLE

Sample
POST http://localhost:8080/mtr-backend/api/role


Update role

URL
PUT <application-url>/api/role/<roleId>

Path parameter

Consumes

application/json
application/xml

com.matterial.mtr.api.object.Role

Produces

application/json
application/xml

com.matterial.mtr.api.object.Role (id only)

Permission
EDIT_ROLE

Sample
PUT http://localhost:8080/mtr-backend/api/role/8


Remove role

URL
DELETE <application-url>/api/role/<roleId>

Path parameter

Produces

text/plain

Integer - count of removed

Permission
EDIT_ROLE

Sample
DELETE http://localhost:8080/mtr-backend/api/role/8


Assign role to person

URL
PUT <application-url>/api/role/<roleId>/byaccount/<accountId>

Path parameter

Produces

application/json
application/xml

List<Person> - assigned persons

Permission
EDIT_ROLE

Sample
PUT http://localhost:8080/mtr-backend/api/role/8/byaccount/5


Assign role to persons

URL
PUT <application-url>/api/role/assign/byaccount

Query parameter

Produces

application/json
application/xml

List<Person> - assigned persons

Permission
EDIT_ROLE

Sample
PUT http://localhost:8080/mtr-backend/api/role/assign/byaccount?roleId=8&accountId=5


Unassign role from person

URL
DELETE <application-url>/api/role/<roleId>/byaccount/<accountId>

Path parameter

Produces

application/json
application/xml

List<Person> - unassigned persons (may be empty)

Permission
EDIT_ROLE

Sample
DELETE http://localhost:8080/mtr-backend/api/role/8/byaccount/5


Unassign roles from persons

URL
DELETE <application-url>/api/role/assign/byaccount

Query parameter

Produces

application/json
application/xml

List<Person> - unassigned persons (may be empty)

Permission
EDIT_ROLE

Sample
DELETE http://localhost:8080/mtr-backend/api/role/assign/byaccount?roleId=8&accountId=5