Component

Here you can manage only components.


Create new

# Http request to create permission
POST http://localhost:8080/api/component HTTP/1.1

Request

Header:
Authorization : Bearer {jwt.token}
Content-Type : application/json
Body:
{
    "name" : "{component name}",
    "description" : "Read operation"
}

Response

Success:

Header:
201 Created

Error:

Header:
Internal Error 500
Body:
{
    "timestamp" : "2018-05-24T12:44:26.295+0000",
    "status" : 500,
    "error" : "Internal Error",
    "message" : "WRONG_COMPONENT",
    "success" : "false",
    "path" : "/api/component"
}

Update permission

# Http request to update permission
PUT http://localhost:8080/api/component/{componentId} HTTP/1.1

Request

Header:
Authorization : Bearer {jwt.token}
Content-Type : application/json
Body:
{
    "enhanceId" : "{componentId}",
    "name" : "{component name}",
    "description" : "Read operation"
}

Response

Success:

Header:
201 Created

Error:

Header:
Internal Error 500
Body:
{
    "timestamp" : "2018-05-24T12:44:26.295+0000",
    "status" : 500,
    "error" : "Internal Error",
    "message" : "CHENGE_DENIED",
    "success" : "false",
    "path" : "/api/component/{componentId}"
}

Get Permission list

# Http request to get all permissions
PUT http://localhost:8080/api/component/all HTTP/1.1

Request

Header:
Authorization : Bearer {jwt.token}
Content-Type : application/json

Response

Success:

Header:
200 OK
Body:
{
    "_embedded": {
        "componentResources": [
            {
                "enhanceId": 1,
                "name": "CONNECTION",
                "description": "Connection description",
                "permissions": null
            },
            {
                "enhanceId": 2,
                "name": "CONNECTOR",
                "description": "Connector description",
                "permissions": null
            },
            {
                "enhanceId": 3,
                "name": "EVENT",
                "description": "Event description",
                "permissions": null
            },
            {
                "enhanceId": 4,
                "name": "USER",
                "description": "User description",
                "permissions": null
            },
            {
                "enhanceId": 5,
                "name": "USERGROUP",
                "description": "User Group description",
                "permissions": null
            },
            {
                "enhanceId": 6,
                "name": "MYPROFILE",
                "description": "My profile description",
                "permissions": null
            }
        ]
    }
}

Error:

Status error could be different depending on error

Header:
Access Denied 401
Body:
{
    "timestamp" : "2018-05-24T12:44:26.295+0000",
    "status" : 401,
    "error" : "Password or email doesnt match",
    "message" : "ACCESS_DENIED",
    "path" : "/api/userGroup/all"
}

Delete Permission

Component could be delete if it is not linked to UserGroup. Otherwise you will get an error

# Http request
DELETE http://localhost:8080/api/component/{componentId} HTTP/1.1

Request

Header:
Authorization : Bearer {jwt.token}
Content-Type : application/json

Response

Success:

Header:
204 No Content

Error:

Body:
{
    "timestamp" : "2018-05-24T12:44:26.295+0000",
    "status" : 500,
    "error" : "Internal Error",
    "message" : "USERGROUP_NOT_DELETED",
    "path" : "/api/userGroup"
}