syntax = "proto3";

package com.wixpress.authorization.abac.management;

message Subject {
    // ID of identity assigned to the asset. 
    string id = 1;
    // Type of identity assigned to the asset. Supported subject types include user IDs, account IDs, and app IDs.
    SubjectType subject_type = 2;
    // Context of identity assigned to the asset. For example, a `subjectType` = `USER` will have `context` = `ACCOUNT`.
    SubjectContext context = 3;
}

message SubjectContext {
    string id = 1;
    SubjectContextType context_type = 2;
}

enum SubjectType {
    UNKNOWN = 0;
    ACCOUNT = 1;
    USER = 2;
    USER_GROUP = 3;
    MEMBER_GROUP = 4;
    VISITOR_GROUP = 5;
    EXTERNAL_APP = 6;
    ACCOUNT_GROUP = 7;
    WIX_APP = 8;
}

enum SubjectContextType {
    UNKNOWN_CTX = 0;
    ORG_CTX = 1;
    ACCOUNT_CTX = 2;
}
