UserService

In this document:

Schema

The User Service type represents a generic service allocated to a user resource through the user relation. Resources that are intended for service users, should implement this type.

Service schema: download

{
    "apsVersion": "2.0",

    "name": "UserService",
    "id": "http://aps-standard.org/types/core/user/service/1.0",

    "implements": ["http://aps-standard.org/types/core/resource/1.0"],

    "relations": {
        "user": {
            "type": "http://aps-standard.org/types/core/user/1.0",
            "required": true
        }
    }
}

Role Assignment

By default, if a service is assigned to a user, the latter gets the referrer role when operating the service. It is possible to redefine the role by means of the assign object inside the respective relation.

In the following type definition, an assigned user will be the service owner:

{
   "apsVersion": "2.0",
   "name": "vps",
   "id": "http://aps-standard.org/samples/suwizard1p/vps/1.0",
   "implements": [
      "http://aps-standard.org/types/core/user/service/1.0"
   ],
   "properties": {
      "name": {
         "type": "string",
         "title": "name",
         "description": "Server Name"
      },
      ...
   "relations": {
      "user": {
         "assign": {
            "access": {
               "owner": true
            }
         },
         "required": true
      }
   }
}

Generally, the assign object can contain any combination of the owner, referrer, and admin roles, but not more than one of them can be true.

Note

If you redefine at least one property of an inherited relation, the inheritance will be lost for the whole relation. It means, you should take care of the other relation properties if they must be different from the default values. That is why in the above example, the required property is redefined along with the assign object.

User
Account