Пример #1
0
        public ServiceResponse <Authorisation> GetAuthorisation()
        {
            var serviceResponse = new ServiceResponse <Authorisation>();

            try
            {
                var activities         = authorisationManagerDataProxy.GetActivities();
                var roles              = authorisationManagerDataProxy.GetRoles(activities);
                var userAuthorisations = authorisationManagerDataProxy.GetUserAuthorisations(roles);

                var authorisation = new Authorisation();
                authorisation.Activities.AddRange(activities);
                authorisation.Roles.AddRange(roles);
                authorisation.UserAuthorisations.AddRange(userAuthorisations);

                serviceResponse = new ServiceResponse <Authorisation>()
                {
                    Payload = authorisation
                };
            }
            catch (Exception ex)
            {
                serviceResponse.IsError = true;
                serviceResponse.Message = ex.Message;
                logger.Log("AuthorisationManagerServer.GetAuthorisation" + ex.Message, LogCategory.Exception, LogPriority.None);
                logger.Log(ex.StackTrace, LogCategory.Exception, LogPriority.None);
            }

            return(serviceResponse);
        }