public bool userHasRole(TemplateScopeContext scope, string role) =>
 userSession(scope)?.HasRole(role, HostContext.AppHost.GetAuthRepository(req(scope))) == true;
 public bool userHasPermission(TemplateScopeContext scope, string permission) =>
 userSession(scope)?.HasPermission(permission, HostContext.AppHost.GetAuthRepository(req(scope))) == true;
 public string userPermanentSessionId(TemplateScopeContext scope) => req(scope).GetPermanentSessionId();
 public HashSet <string> userSessionOptions(TemplateScopeContext scope) => req(scope).GetSessionOptions();
 private IHttpRequest req(TemplateScopeContext scope) => scope.GetValue("Request") as IHttpRequest;
 public IAuthSession userSession(TemplateScopeContext scope) => req(scope).GetSession();
 public string userName(TemplateScopeContext scope) => req(scope).GetSession()?.UserAuthName ?? req(scope).GetSession()?.UserName;
 public string userEmail(TemplateScopeContext scope) => req(scope).GetSession()?.Email;
Exemple #9
0
 public Task <object> asyncDictionary(TemplateScopeContext scope)
 {
     return(((object)new Dictionary <string, object> {
         { "foo", 1 }, { "bar", 2 }
     }).InTask());
 }
 public string userId(TemplateScopeContext scope) => req(scope).GetSession()?.UserAuthId;
Exemple #11
0
 public Task <object> asyncInts(TemplateScopeContext scope)
 {
     return(((object)new object[] { 1, 2, 3 }).InTask());
 }
 public HostConfig hostConfig(TemplateScopeContext scope) => HostContext.Config;
 public string hostServiceName(TemplateScopeContext scope) => HostContext.AppHost.ServiceName;
 public override object Evaluate(TemplateScopeContext scope) => this;
 public override object Evaluate(TemplateScopeContext scope)
 {
     return(Argument.Evaluate(scope));
 }