Exemplo n.º 1
0
        public List <OAuthAuthorization> GetOAuthUserAuthorizations(String clientApiKey)
        {
            List <ClientAuthorization> authorizations =
                Authorization.GetUserAuthorizationsForClient(ArenaContext.Current.User.Identity.Name, clientApiKey, false);
            List <OAuthAuthorization> list   = new List <OAuthAuthorization>();
            OAuthAuthorizationMapper  mapper = new OAuthAuthorizationMapper();

            foreach (ClientAuthorization auth in authorizations)
            {
                list.Add(mapper.FromArena(auth));
            }
            return(list);
        }
Exemplo n.º 2
0
        public GenericListResult <OAuthAuthorization> GetOAuthUserAuthorizations(String clientApiKey)
        {
            List <ClientAuthorization> authorizations =
                Authorization.GetUserAuthorizationsForClient(ArenaContext.Current.User.Identity.Name, clientApiKey, false);
            GenericListResult <OAuthAuthorization> list = new GenericListResult <OAuthAuthorization>();

            list.Items = new List <OAuthAuthorization>();
            OAuthAuthorizationMapper mapper = new OAuthAuthorizationMapper();

            foreach (ClientAuthorization auth in authorizations)
            {
                list.Items.Add(mapper.FromArena(auth));
            }
            list.Total = list.Max = list.Items.Count();
            list.Start = 0;

            return(list);
        }