Skip to content

Commit

Permalink
Merge pull request #1850 from YunoHost/mailalias-force
Browse files Browse the repository at this point in the history
Allow to force-adding aliases for special groups
  • Loading branch information
alexAubin authored Sep 17, 2024
2 parents b8c12f2 + 1e13c61 commit eb8a1b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions share/actionsmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ user:
extra:
pattern: *pattern_username

### user_group_add_mailalias()
add-mailalias:
action_help: Add mail aliases to group
api: PUT /users/groups/<groupname>/aliases/<aliases>
Expand All @@ -336,6 +337,11 @@ user:
metavar: MAIL
extra:
pattern: *pattern_email
--force:
help: Ignore warnings about special groups
action: store_true

### user_group_remove_mailalias()
remove-mailalias:
action_help: Remove mail aliases to group
api: DELETE /users/groups/<groupname>/aliases/<aliases>
Expand All @@ -348,8 +354,9 @@ user:
help: Mail aliases to remove
nargs: "+"
metavar: MAIL


--force:
help: Ignore warnings about special groups
action: store_true

permission:
subcategory_help: Manage permissions
Expand Down
8 changes: 4 additions & 4 deletions src/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,12 @@ def user_group_remove(groupname, usernames, force=False, sync_perm=True):
)


def user_group_add_mailalias(groupname, aliases):
return user_group_update(groupname, add_mailalias=aliases, sync_perm=False)
def user_group_add_mailalias(groupname, aliases, force=False):
return user_group_update(groupname, add_mailalias=aliases, force=force, sync_perm=False)


def user_group_remove_mailalias(groupname, aliases):
return user_group_update(groupname, remove_mailalias=aliases, sync_perm=False)
def user_group_remove_mailalias(groupname, aliases, force=False):
return user_group_update(groupname, remove_mailalias=aliases, force=force, sync_perm=False)


#
Expand Down

0 comments on commit eb8a1b3

Please sign in to comment.