Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test "roles" query #20

Closed
Sddilora opened this issue Apr 1, 2024 · 3 comments
Closed

Test "roles" query #20

Sddilora opened this issue Apr 1, 2024 · 3 comments
Assignees
Labels
Be sub-issue Sub-task within a larger task testing Tasks or issues for testing system functionality and reporting any identified issues

Comments

@Sddilora
Copy link
Member

Sddilora commented Apr 1, 2024

Test the "roles" query with all possible cases and create an issue if any bugs are found. If you encounter unexpected behavior or are unsure if it is intended, please create an issue for that as well.

@Sddilora Sddilora self-assigned this Apr 1, 2024
@Sddilora
Copy link
Member Author

Sddilora commented Apr 1, 2024

Query :

query getRoles {
  roles(
    filter:{
      RoleName:"USER"
    }
  ){
    RoleName
    PermissionGroups{
      GroupName
      Permissions{
        Policy
      }
    }
  }
}

Output :

{
  "data": {
    "roles": [
      {
        "RoleName": "USER",
        "PermissionGroups": [
          {
            "GroupName": "none",
            "Permissions": [
              {
                "Policy": "none"
              }
            ]
          },
          {
            "GroupName": "user.viewer",
            "Permissions": [
              {
                "Policy": "user.read"
              },
              {
                "Policy": "user.list"
              }
            ]
          }
        ]
      }
    ]
  }
}

I'm unsure about that part. The "none" field is returned in all roles. Is this intentional or is it a bug?

          {
            "GroupName": "none",
            "Permissions": [
              {
                "Policy": "none"
              }
            ]
          },

@husamettinarabaci

@mervegonc
Copy link
Member

mervegonc commented Apr 7, 2024

1
2

When I login as "op_user", "op_manager", "op_admin" and query with RoleName: "USER" or RoleName: "MANGER" in the filter, I got the same results as number 1.
When I login as "op_user", "op_manager", "op_admin" and query with RoleName: "ADMIN" in the filter, I got the same results as number 2.

QUERY

query test_roles{
  roles(filter: { RoleName: "USER" }) {
    RoleName
     PermissionGroups{
      GroupName
       Permissions{
        Policy
      }
    }
  }
}

@mervegonc
Copy link
Member

mervegonc commented Apr 7, 2024

I login as 3 different accounts as "op_user", "op_manager", "op_admin" I got the same results.

QUERY;

query second_getAll_test_roles{
   roles{
    RoleName
     PermissionGroups{
      GroupName
       Permissions{
        Policy
      }
    }
  }
}

Results;

{
  "data": {
    "roles": [
      {
        "RoleName": "ADMIN",
        "PermissionGroups": [
          {
            "GroupName": "none",
            "Permissions": [
              {
                "Policy": "none"
              }
            ]
          },
          {
            "GroupName": "user.manager",
            "Permissions": [
              {
                "Policy": "user.read"
              },
              {
                "Policy": "user.list"
              },
              {
                "Policy": "user.create"
              },
              {
                "Policy": "user.update.role"
              },
              {
                "Policy": "user.change.password"
              },
              {
                "Policy": "user.update.base"
              },
              {
                "Policy": "user.update.status"
              },
              {
                "Policy": "user.delete"
              }
            ]
          }
        ]
      },
      {
        "RoleName": "MANAGER",
        "PermissionGroups": [
          {
            "GroupName": "none",
            "Permissions": [
              {
                "Policy": "none"
              }
            ]
          },
          {
            "GroupName": "user.viewer",
            "Permissions": [
              {
                "Policy": "user.read"
              },
              {
                "Policy": "user.list"
              }
            ]
          }
        ]
      },
      {
        "RoleName": "USER",
        "PermissionGroups": [
          {
            "GroupName": "none",
            "Permissions": [
              {
                "Policy": "none"
              }
            ]
          },
          {
            "GroupName": "user.viewer",
            "Permissions": [
              {
                "Policy": "user.read"
              },
              {
                "Policy": "user.list"
              }
            ]
          }
        ]
      }
    ]
  }
}

@Sddilora Sddilora assigned mervegonc and unassigned Sddilora Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Be sub-issue Sub-task within a larger task testing Tasks or issues for testing system functionality and reporting any identified issues
Projects
None yet
Development

No branches or pull requests

3 participants