@param req HTTP request

@return List of all roles
184898
@GET
  @Path("/db/{authorizerName}/roles")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(BasicSecurityResourceFilter.class)
  public Response getAllRoles(
      @Context HttpServletRequest req,
      @PathParam("authorizerName") final String authorizerName
  )
  {
    return resourceHandler.getAllRoles(authorizerName);
  }
1222626
def role_entities(self):
        
        return [self.service.roles[name] for name in self.content.roles]
1151752
public List<RpcResponse> request(List<RpcRequest> reqList) {
        for (RpcRequest req : reqList) {
            this.reqList.add(req);
        }

        return null;
    }
950059
private Pair<String, String>[] getAllParams(final HttpServletRequest req) {
    final List<Pair<String, String>> allParams = new LinkedList<>();

    final Iterator it = req.getParameterMap().entrySet().iterator();
    while (it.hasNext()) {
      final Map.Entry pairs = (Map.Entry) it.next();
      for (final Object value : (String[]) pairs.getValue()) {
        allParams.add(new Pair<>((String) pairs.getKey(), (String) value));
      }
    }

    return allParams.toArray(new Pair[allParams.size()]);
  }
90774
@Override
    @Path("/{roleName}")
    @ApiOperation(value="Retrieve a role or all roles",
        notes="If roleName is not present, returns all roles.",
        response=Role.class, responseContainer="List")
    public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
        UserServices userServices = ServiceLocator.getUserServices();
        Map<String,String> parameters = getParameters(headers);
        try {
            String roleName = parameters.get("name");
            if (roleName == null) // use request path
                roleName = getSegment(path, 1);
            if (roleName != null) {
                Role role = userServices.getRole(roleName);
                if (role == null)
                    throw new ServiceException(HTTP_404_NOT_FOUND, "Role not found: " + roleName);
                return role.getJson();
            }
            else {
                return userServices.getRoles().getJson();
            }
        }
        catch (DataAccessException ex) {
            throw new ServiceException(ex.getMessage(), ex);
        }
    }
1184991
function getRoles (session) {
    // return roles from session or default
    return session && Array.isArray(session.roles)
        ? session.roles
        // default roles
        : ['all', (session && session.accountId ? 'authenticated' : 'anonymous')]
}
570412
public static Collection<Locale> getLocales(final HttpServletRequest req) {
    if (req.getHeader("Accept-Language") == null) {
      return null;
    }

    @SuppressWarnings("unchecked")
    Enumeration<Locale> lcs = req.getLocales();
    ArrayList<Locale> locales = new ArrayList<Locale>();
    while (lcs.hasMoreElements()) {
      locales.add(lcs.nextElement());
    }

    return locales;
  }
957723
public List<String> getRoles(String appId) {
    if (roles.containsKey(appId)) {
      return Collections.unmodifiableList(roles.get(appId));
    } else {
      return null;
    }
  }
833296
def list_roles(self):
        """"""

        json_resp = self.get_roles()
        temp_dict = {}
        for item in json_resp:
            temp_dict[item["name"]] = item["id"]
        return temp_dict
793580
protected List<String> getRoles(String path, String method) {
        if (method.equals("GET")) {
            List<String> roles = new ArrayList<>();
            // restrict if view access role exists
            if (UserGroupCache.getRole(Role.RUNTIME_VIEW) != null) {
                roles.add(Role.RUNTIME_VIEW);
                roles.add(Role.PROCESS_EXECUTION);
                roles.add(Workgroup.SITE_ADMIN_GROUP);
            }
            return roles;
        }
        return getRoles(path);
    }
35823
def get_roles():
    """"""
    roles = []
    for root, subfolders, files in os.walk('roles'):
        for filename in files:
            if filename.endswith(".json"):
                path = os.path.join(
                    root[len('roles'):], filename[:-len('.json')])
                roles.append(_get_role(path))
    return sorted(roles, key=lambda x: x['fullname'])
272514
protected function createListAllRolesResponse(ListAllRolesRequest $request, Pbjx $pbjx): ListAllRolesResponse
    {
        /** @var ListAllRolesResponse $response */
        $response = $this->createResponseFromRequest($request, $pbjx);
        return $response;
    }
1333019
public Set<String> getRoles() {
        HashSet<String> rolescopy;
        rolescopy = new HashSet<>(roles);
        return Collections.unmodifiableSet(rolescopy);
    }
951911
def list_roles(self, principal_name, principal_type):
    
    self.send_list_roles(principal_name, principal_type)
    return self.recv_list_roles()
1185283
function list(req, res, next) {
  logger.debug("Middleware Submissions List ", {connectionOptions: req.connectionOptions});
  forms.getSubmissions(req.connectionOptions, {}, _getSubmissionsResultHandler(req, next));
}
163175
def role_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for role in kstone.roles.list():
        ret[role.name] = dict((value, getattr(role, value)) for value in dir(role)
                              if not value.startswith('_') and
                              isinstance(getattr(role, value), (six.string_types, dict, bool)))
    return ret
206358
public static List<String> getCallbackUserRoles(UserGroupCallback userGroupCallback, String userId) {
		List<String> roles = userGroupCallback != null ? userGroupCallback.getGroupsForUser(userId) : new ArrayList<>();
		if (roles == null || roles.isEmpty()) {
			roles = new ArrayList<>();
			roles.add("");
		}

		return roles;
	}