コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 public AuthorizedOperations GetAuthorisedOperations(string appName, UserToken token)
 {
     return new AuthorizedOperations { OperationNames = _operationNames };
 }
コード例 #4
0
 public string[] GetRoles(string appName, UserToken token)
 {
     return _roles;
 }