Пример #1
0
        public async Task <Result <IList <string> > > GetPermissions(string sessionId)
        {
            this.logger.LogDebug("GetPermissions");
            try
            {
                var res = await client.GetPermissions(sessionId);

                var isAuthorized = CheckAuthorization(res);
                if (!isAuthorized)
                {
                    return(Result <IList <string> > .Failure(new UnauthorizedAccessException()));
                }
                return(Result <IList <string> > .Success(converter.ParsePermissions(res)));
            }
            catch (Exception e)
            {
                this.logger.LogError(e, "GetPermissions");
                return(Result <IList <string> > .Failure(e));
            }
        }