inab / benchmarking-data-model

OpenEBench Benchmarking Data Model repository
Creative Commons Attribution Share Alike 4.0 International
2 stars 7 forks source link

add "community_roles" security attribute #116

Closed redmitry closed 4 years ago

redmitry commented 4 years ago

Define "cmanager" and "ccontributor" roles for now.

redmitry commented 4 years ago

This commit would be OK only if the contact belongs to one community. If we want support more than one community there must be an array of communities each of them having its own roles assigned.

"privelegies" : {
  "title": "Communities the contact belogs to",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "community_id": {
        "title": "The community id where this contact belongs to",
        "type": "string",
        "foreign_keys": [
          {
            "schema_id": "Community",
            "members": [ "." ]
      }
        ],
        "minLength": 7
      },
      "challenge_id": {
       "title": "The challenge id the user has priviledges",
        "type": "string",
        "foreign_keys": [
          {
            "schema_id": "Challenge",
            "members": [ "." ]
      }
        ],
        "minLength": 7
      },
      "roles": {
        "title": "Community roles applied to the contact",
        "type": "array",
        "items": {
          "type": "string",
          "enum":  [ "cmanager", "ccontributor" ]
        }
      }
    }
  }
}