anchor.diff:      catch error:badarg ->
               '_unknown_'
       end.
  -
  -maybe_parse_permission(undefined) ->
  -    undefined;
  -maybe_parse_permission(RawPermission) ->
  -    parse_permission(RawPermission).
   
   parse_permission(RawPermission) ->
       case string:tokens(RawPermission, "!") of
  
positive.code: role_to_json({Name, [BucketName]}) ->
      [{role, Name}, {bucket_name, list_to_binary(BucketName)}].
  
  get_roles_by_permission(Permission) ->
      Config = ns_config:get(),
      Roles = menelaus_roles:get_all_assignable_roles(Config),
      filter_roles_by_permission(Config, Permission, Roles).
  
negative.code:             handle_get_users_with_domain(Req, DomainAtom, Path)
      end.
  
  get_roles_for_users_filtering(undefined) ->
      all;
  get_roles_for_users_filtering(Permission) ->
      filter_roles_by_permission(Permission).
  
  handle_get_users_with_domain(Req, DomainAtom, Path) ->
      Query = Req:parse_qs(),
      case lists:keyfind("pageSize", 1, Query) of
          false ->
              menelaus_util:execute_if_validated(
                handle_get_all_users(Req, {'_', DomainAtom}, _), Req, Query,
                get_users_or_roles_validators());
          _ ->
              HasStartFrom = lists:keyfind("startFrom", 1, Query) =/= false,
              menelaus_util:execute_if_validated(
                handle_get_users_page(Req, DomainAtom, Path, _),
                Req, Query, get_users_page_validators(DomainAtom, HasStartFrom))
      end.
  
  handle_get_users_45(Req) ->
  