Skip to content

Conversation

@amCap1712
Copy link
Contributor

Introduce a new announcement.add permission to control access to announcement posting. Also, add a new role "Translation coordinator" to include this permission. Fixes #8974.

Questions:

  1. I haven't updated the documentation because the name and permissions for the to be introduced "Translation coordinator" are not yet finalized. Currently, I am using the same as mentioned in the linked issue.
  2. There is a dummy announcement.delete permission.
    @register_perm("announcement.delete")
    def check_announcement_delete(user: User, permission: str, obj: Model):
    I think that permission should either be merged with the announcement.add permission or converted to separate real permission.
  3. There is an existing permission called announcement.edit on the global level. Should this new permission (and the delete permission) be renamed to something different to avoid confusion?

Reminder: add changelog note to run setupgroups to update role.

@amCap1712 amCap1712 requested a review from nijel as a code owner May 25, 2025 12:19
@amCap1712 amCap1712 changed the title feat(announcement): Add permission for posting announcements and update roles feat(announcement): Add permission for posting announcements and new role May 25, 2025
@nijel
Copy link
Member

nijel commented May 26, 2025

Introduce a new announcement.add permission to control access to announcement posting. Also, add a new role "Translation coordinator" to include this permission. Fixes #8974.

Questions:

  1. I haven't updated the documentation because the name and permissions for the to be introduced "Translation coordinator" are not yet finalized. Currently, I am using the same as mentioned in the linked issue.

I think it is a good name, let's stick with that. ./manage.py list_permissions will generate most the access control documentation from the code.

  1. There is a dummy announcement.delete permission.
    @register_perm("announcement.delete")
    def check_announcement_delete(user: User, permission: str, obj: Model):

    I think that permission should either be merged with the announcement.add permission or converted to separate real permission.

It grants the permission based on the announcement scope, but the question is how much is that used. Anyway, component scoped team with the announcement.delete permission would work as replacement. It just needs to be documented, as this is not something we can easily handle in the migrations. So probably having a real announcement.delete permission is a way to go.

  1. There is an existing permission called announcement.edit on the global level. Should this new permission (and the delete permission) be renamed to something different to avoid confusion?

That one has name Manage announcements so probably is not that confusing. It probably should have been called announcement.manage, but I'm not sure it's worth of renaming it.

Reminder: add changelog note to run setupgroups to update role.

This is done automatically on migrate, no need to run it manually.

Introduce a new `announcement.add` permission to control access to announcement posting.
Also, add a new role "Translation coordinator" to include this permission. Fixes WeblateOrg#8974.
@amCap1712
Copy link
Contributor Author

Updated the docs. I'll open a ticket for making announcement.delete a real permission and adding it to the translation coordinator role.

@nijel nijel self-assigned this Jun 11, 2025
@nijel nijel added this to the 5.12 milestone Jun 11, 2025
@nijel nijel enabled auto-merge (squash) June 11, 2025 17:48
@nijel nijel merged commit a67b0d2 into WeblateOrg:main Jun 11, 2025
48 of 51 checks passed
@amCap1712 amCap1712 deleted the post-announcements branch July 4, 2025 17:41
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 this pull request may close these issues.

Add separate 'post announcements' permission

2 participants