public string[] GetRoles(string appName, UserToken token) { Log.Info("Call made to GetRoles"); try { Store.UsingApplication(appName); var opNames = Store.GetRoles(appName).Where(r => r.Members.Any(m => token.Sids.Contains(m.Id)) ); return opNames.Select(r => r.Name).ToArray(); } catch (Exception ex) { Log.Error(ex.Message, ex); throw; } }
public AuthorizedOperations GetAuthorisedOperations(string appName, UserToken token) { Log.Info("Call made to GetAuthorisedOperations"); try { Store.UsingApplication(appName); var opNames = Store.GetAuthroizedOperations(appName, token.Sids); return new AuthorizedOperations { OperationNames = opNames }; } catch (Exception ex) { Log.Error(ex.Message, ex); throw; } }
public AuthorizedOperations GetAuthorisedOperations(string appName, UserToken token) { return new AuthorizedOperations { OperationNames = _operationNames }; }
public string[] GetRoles(string appName, UserToken token) { return _roles; }