Forum Discussion

yogeshdixit's avatar
2 months ago
Solved

liqlAdmin in khoros aurora graphql API

Hi Folks,

I want to add roles to the users using graphQL API given below.

const ADD_USER_ROLE_MUTATION = gql`
    mutation addUsersToRole($roleKey: RoleKeyInput!, $users: [UserIdInput!]!) {
      addUsersToRole(roleKey: $roleKey, users: $users) {
        result {
          id
          name
        }
      }
    }
  `;
  const [addUserRole] = useMutation(ADD_USER_ROLE_MUTATION);


addUserRole({
              variables: {
                roleKey: { roleName: "role" },
                users: [{ id: userId }]
              }
            });

The issue I am facing is that when this mutation is executed by an Admin user, the role is successfully added to the target user. However, when the same mutation is executed by a normal user, it fails to add the role due to permission denied errors.

Is there a parameter or keyword that can be used in this mutation to allow a normal user to update their own roles or self-related data?

For example, in Khoros Classic, we can use the liqlAdmin keyword in REST API requests to bypass such permissions. Is there an equivalent for GraphQL in Khoros Aurora?

Thanks in Advance.

  • yogeshdixitChange the package name to "@customer/catfact-endpoint". If it still doesn’t work then request the Khoros support team to restart the community.

12 Replies