Exemple #1
0
        public async Task <List <string> > GetUserRoles(int siteId, int userId)
        {
            List <string> userRoles = new List <string>();

            using (DbDataReader reader = await dbSiteUser.GetRolesByUser(siteId, userId))
            {
                while (reader.Read())
                {
                    userRoles.Add(reader["RoleName"].ToString());
                }
            }

            return(userRoles);
        }
        public async Task <List <string> > GetUserRoles(int siteId, int userId, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            List <string> userRoles = new List <string>();

            using (DbDataReader reader = await dbSiteUser.GetRolesByUser(siteId, userId))
            {
                while (reader.Read())
                {
                    userRoles.Add(reader["RoleName"].ToString());
                }
            }

            return(userRoles);
        }
        public async Task <List <string> > GetUserRoles(int siteId, int userId)
        {
            if (multiTenantOptions.UseRelatedSitesMode)
            {
                siteId = multiTenantOptions.RelatedSiteId;
            }
            List <string> userRoles = new List <string>();

            using (DbDataReader reader = await dbSiteUser.GetRolesByUser(siteId, userId))
            {
                while (reader.Read())
                {
                    userRoles.Add(reader["RoleName"].ToString());
                }
            }

            return(userRoles);
        }