{
	"name": "AclRole",
	"base": "PersistedModel",
	"properties": {
		"id": {
			"type": "string",
			"id": true,
			"generated": false
		},
		"name": {
			"type": "string",
			"required": true
		},
		"description": "string",
		"scopeType": {
			"type": "string",
			"index": true
		},
		"scopeId": {
			"type": "string",
			"index": true
		}
	},
	"relations": {
		"scope": {
			"type": "belongsTo",
			"polymorphic": {
				"idType": "string"
			}
		},
		"inherits": {
			"type": "referencesMany",
			"model": "AclRole",
			"foreignKey": "parentIds",
			"options": {
				"validate": true,
				"forceId": false
			}
		},
		"mappings": {
			"type": "hasMany",
			"model": "AclMapping",
			"foreignKey": "roleId"
		},
		"permissions": {
			"type": "hasMany",
			"model": "AclPermission",
			"polymorphic": "subject"
		}
	},
	"security": {
		"permissions": [
			{
				"action": "create",
				"property": "create"
			},
			{
				"action": "read",
				"property": "find"
			},
			{
				"action": "write",
				"property": "updateById"
			},
			{
				"action": "delete",
				"property": "destroyById"
			}
		]
	}
}
