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

Folder permissions #213

Open
Lusitaniae opened this issue Feb 22, 2022 · 4 comments · May be fixed by #231
Open

Folder permissions #213

Lusitaniae opened this issue Feb 22, 2022 · 4 comments · May be fixed by #231

Comments

@Lusitaniae
Copy link
Contributor

SUMMARY

We're using Grafana to let customers see data on their own environments.

We usually create a folder and add the customer 'team' with the role of viewer

Which seems to be missing here

@Lusitaniae
Copy link
Contributor Author

Seems it would require a 2nd API call to set the correct permissions

Worthwhile adding to folder module or making a new one?

https://grafana.com/docs/grafana/latest/http_api/folder_permissions/

@Lusitaniae
Copy link
Contributor Author

Ansible task to do it

    - name: Set folder permissions
      uri:
        url: "{{ url }}/api/folders/{{ folder.folder.uid }}/permissions"
        method: POST
        body: | # 1 - viewer | 2 - editor # teamId requires int here, otherwise returns 400
            {"items": [{"role": "Editor", "permission": 2}, {"teamId": {{ team_id }}, "permission": 1}]}
        body_format: json
        return_content: yes
        headers:
          Authorization: "Bearer {{ grafana_key }}"
      register: folder_perms```

@rrey
Copy link
Collaborator

rrey commented Feb 23, 2022

Hi @Lusitaniae that's a nice addition for the folder module I guess.

I won't be able to work on it unfortunately :( PR welcome !

Thanks for creating issues lately, that's helping 👍

@Lusitaniae
Copy link
Contributor Author

Understand, thanks for all your work so far!

@CWollinger CWollinger linked a pull request Apr 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants