namespace AyCode.Database;

public static class PermissionSqls
{
    public const string PermissionViewSql = "select distinct pcm.Id, pcm.ContextId, pgum.SubjectId SubjectId, pcm.Permissions, pcm.IsBuiltin, 10 SubjectType, pcm.Created, pcm.Modified " +
                                                "from PermissionGroupUserMapping as pgum " +
                                                    "left join PermissionGroups as pg on (pgum.PermissionGroupId = pg.Id) " +
                                                    "left join PermissionContextMapping as pcm on (pg.Id = pcm.SubjectId) " +
                                            "union " +
                                            "select Id, ContextId, SubjectId, Permissions, IsBuiltin, 5 SubjectType, Created, Modified from PermissionContextMapping pcm";
}