Genesys Cloud - Main

 View Only

Sign Up

Expand all | Collapse all

Error "Your default role is out of date. Click here to see changes." when creating a new role using AuthorizationApi

  Thread closed by the administrator, not accepting new replies.
  • 1.  Error "Your default role is out of date. Click here to see changes." when creating a new role using AuthorizationApi

    Posted 12-05-2023 12:05
    Edited by Shai Alon 12-05-2023 15:17
    No replies, thread closed.

    Hi.

    I'm trying to create a new role using the AuthorizationApi, like this:

           List<DomainPermissionPolicy> policies = permissions
                .stream()
                .map(permission -> new DomainPermissionPolicy()
                    .domain(permission).entityName("*")
                    .actionSet(Collections.singletonList("*")))
                .collect(Collectors.toList());
            DomainOrganizationRoleCreate createRequest = new DomainOrganizationRoleCreate();
            createRequest.setName(roleName);
            createRequest.setDescription(roleName);
            createRequest.setBase(false);
            createRequest.setPermissionPolicies(policies);
            createRequest.setDefault(false);
    
            PostAuthorizationRolesRequest postAuthorizationRolesRequest = new PostAuthorizationRolesRequest();
            postAuthorizationRolesRequest.withBody(createRequest);
            return ApiCallWrapper.execute(() -> authApi.postAuthorizationRoles(postAuthorizationRolesRequest));

    The role is created, but with the error "Your default role is out of date. Click here to see changes."

    If I press the "Dismiss new changes" - all added permissions are removed.
    I don't have a default role id to assign so it's null, but I used setDefault(false), which didn't help.

    How can I fix this?


    #SystemAdministration #NewRole #DefaultRole #DefaultRoleId #RolePermissions

    ------------------------------
    Shai Alon
    Genesys - Employees
    ------------------------------



  • 2.  RE: Error "Your default role is out of date. Click here to see changes." when creating a new role using AuthorizationApi

    Posted 12-06-2023 03:21
    No replies, thread closed.

    I solved it by adding the following:

    createRequest.setDefaultRoleId("masterAdmin");


    ------------------------------
    Shai Alon
    Genesys - Employees
    ------------------------------