Add Roles to Administration, with Stalwart's permissions in every language
A role is a named set of permissions given to accounts, groups and tenants. It gets its own section under a new Access heading: every role listed with the permissions it grants once its bases are followed, and a panel to create, edit and delete one. A role builds on others and has everything they grant; a denial anywhere in the tree wins, which is how Stalwart resolves it (permissions.rs unions enabled and disabled across the tree, then subtracts). The picker is Stalwart's own list of permissions, under its headings, searchable and filterable to what is granted or set here. Each permission is not set, allowed or denied, and one that is inherited says which role it comes from. Only permissions the viewer holds can be allowed, because Stalwart refuses the rest, and a role carrying anything the viewer lacks opens read-only with no delete, because Stalwart checks a grant but not a delete. Saving sends a pointer for each permission and base role that changed. The roles Stalwart hands out by default, read from x:Authentication, say so before they are changed and cannot be deleted here; a role still in use is kept by the server, and the refusal names what uses it. The permission list is Stalwart's schema. A new route, GET /api/admin/permissions, fetches /api/schema as the signed-in account and returns only names and labels, behind the same two gates as the registry methods and held in memory for an hour. Its labels are English only, so every one of the 661 has a translation in each of the eight other languages, in its own file keyed by permission name and loaded only when Roles opens. A permission a later Stalwart adds shows its English label. A test holds every language to the 0.16.22 snapshot: nothing missing, nothing stale. The mock answers x:Role/set with the grant check, loops and in-use refusals, reads the defaults from x:Authentication, and serves the schema gzipped as the real one is. Fifty-two new strings and two plurals in all nine catalogues, and 661 permission labels with 59 headings in each of the eight translations.
This commit is contained in:
@@ -202,6 +202,58 @@ export const catalog: Catalog = {
|
||||
"Your organisation has reached the number of mailing lists it is allowed.": "Sua organização atingiu o número de listas de e-mail permitido.",
|
||||
"This mailing list no longer exists. Someone may have deleted it.": "Esta lista de e-mail não existe mais. Alguém pode tê-la excluído.",
|
||||
"The server did not say whether the list was created.": "O servidor não informou se a lista foi criada.",
|
||||
"Roles": "Funções",
|
||||
"users": "usuários",
|
||||
"groups": "grupos",
|
||||
"tenant administrators": "administradores de locatário",
|
||||
"administrators": "administradores",
|
||||
"A role needs a name.": "Uma função precisa de um nome.",
|
||||
"Created {name}": "{name} criada",
|
||||
"New role": "Nova função",
|
||||
"This role carries permissions yours doesn't, so you can view it but not change it.": "Esta função tem permissões que a sua não tem, então você pode vê-la, mas não alterá-la.",
|
||||
"Your role lets you view roles but not change them.": "Sua função permite ver as funções, mas não alterá-las.",
|
||||
"Stalwart gives this role by default to {kinds}. A change here reaches everyone who has it that way.": "O Stalwart atribui esta função por padrão a {kinds}. Uma alteração aqui afeta todos que a têm dessa forma.",
|
||||
"Builds on": "Baseia-se em",
|
||||
"Permissions": "Permissões",
|
||||
"Stalwart gives this role by default, so it can't be deleted. Change the defaults in Stalwart's own administration first.": "O Stalwart atribui esta função por padrão, então ela não pode ser excluída. Altere primeiro os padrões na administração do próprio Stalwart.",
|
||||
"This role carries permissions yours doesn't.": "Esta função tem permissões que a sua não tem.",
|
||||
"Create role": "Criar função",
|
||||
"builds on this one": "baseia-se nesta",
|
||||
"has permissions yours doesn't": "tem permissões que a sua não tem",
|
||||
"No other roles": "Nenhuma outra função",
|
||||
"A role has every permission of the roles it builds on, apart from any it or they deny.": "Uma função tem todas as permissões das funções em que se baseia, exceto as que ela ou elas negarem.",
|
||||
"Search permissions": "Pesquisar permissões",
|
||||
"All permissions": "Todas as permissões",
|
||||
"Granted": "Concedidas",
|
||||
"Set on this role": "Definidas nesta função",
|
||||
"No permissions match": "Nenhuma permissão corresponde",
|
||||
"{granted} of {total}": "{granted} de {total}",
|
||||
"Denied by {role}": "Negada por {role}",
|
||||
"Granted by {role}": "Concedida por {role}",
|
||||
"Inherit": "Herdar",
|
||||
"Not set": "Não definida",
|
||||
"Allow": "Permitir",
|
||||
"Deny": "Negar",
|
||||
"A denial wins over anything allowed, here or on a role this one builds on. You can only allow permissions you hold yourself.": "Uma negação prevalece sobre qualquer permissão, aqui ou numa função em que esta se baseia. Você só pode permitir permissões que você mesmo tem.",
|
||||
"Accounts, groups and other roles that use it must be moved off it first.": "Contas, grupos e outras funções que a usam precisam ser desvinculados dela primeiro.",
|
||||
"Delete role…": "Excluir função…",
|
||||
"Deleted {name}": "{name} excluída",
|
||||
"Still used by {things}. Move them to another role first.": "Ainda usada por {things}. Atribua outra função a eles primeiro.",
|
||||
"Delete role": "Excluir função",
|
||||
"It can't be undone.": "Isso não pode ser desfeito.",
|
||||
"Type {name} to confirm": "Digite {name} para confirmar",
|
||||
"Stalwart's list of permissions could not be loaded, so permissions can't be changed here. ({reason})": "Não foi possível carregar a lista de permissões do Stalwart, então as permissões não podem ser alteradas aqui. ({reason})",
|
||||
"Named sets of permissions, given to accounts, groups and tenants.": "Conjuntos nomeados de permissões, atribuídos a contas, grupos e locatários.",
|
||||
"Search roles": "Pesquisar funções",
|
||||
"No roles match": "Nenhuma função corresponde",
|
||||
"No roles yet": "Nenhuma função ainda",
|
||||
"Open {name}": "Abrir {name}",
|
||||
"Default for {kinds}": "Padrão para {kinds}",
|
||||
"You can't give a role permissions your own role doesn't have.": "Você não pode dar a uma função permissões que a sua própria função não tem.",
|
||||
"Your organisation has reached the number of roles it is allowed.": "Sua organização atingiu o número de funções permitido.",
|
||||
"This role no longer exists. Someone may have deleted it.": "Esta função não existe mais. Alguém pode tê-la excluído.",
|
||||
"the default roles": "as funções padrão",
|
||||
"The server did not say whether the role was created.": "O servidor não informou se a função foi criada.",
|
||||
"User": "Usuário",
|
||||
"Administrator": "Administrador",
|
||||
"Custom role": "Função personalizada",
|
||||
@@ -1598,6 +1650,8 @@ export const catalog: Catalog = {
|
||||
"Its {n} members are taken out of the group first, and lose what was shared with it. The group's own mail is removed in the background, and it can't be undone.": { one: "O {n} membro é retirado do grupo primeiro e perde o que era compartilhado com ele. Os e-mails do grupo são removidos em segundo plano, e isso não pode ser desfeito.", other: "Os {n} membros são retirados do grupo primeiro e perdem o que era compartilhado com ele. Os e-mails do grupo são removidos em segundo plano, e isso não pode ser desfeito." },
|
||||
"{n} mailing lists": { one: "{n} lista de e-mails", other: "{n} listas de e-mails" },
|
||||
"{n} recipients": { one: "{n} destinatário", other: "{n} destinatários" },
|
||||
"Grants {n} permissions": { one: "Concede {n} permissão", other: "Concede {n} permissões" },
|
||||
"{n} roles": { one: "{n} função", other: "{n} funções" },
|
||||
"{n} DKIM keys": { one: "{n} chave DKIM", other: "{n} chaves DKIM" },
|
||||
"{n} other items": { one: "{n} outro item", other: "{n} outros itens" },
|
||||
// ── Administration ────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user