Package version (if known): 1.4.2
Describe the bug
It is possible to register multiple ActionRoles with same values despite the SQLAlchemy UniqueConstraint (https://github.com/inveniosoftware/invenio-access/blob/master/invenio_access/models.py#L115-L118) if argument is None.
Steps to Reproduce
access_actionsroles table initial state

from invenio_access import action_factory, ActionRoles
from invenio_accounts.models import Role
from invenio_db import db
import random
random_role = random.choice(Role.query.all())
action = action_factory('my-action')
action_arg = action_factory('my-action-arg', parameter=True)
for i in range(3):
db.session.add(ActionRoles.allow(action, role=random_role))
db.session.commit()
for i in range(3):
try:
db.session.add(ActionRoles.allow(action_arg('argValue'), role=random_role))
db.session.commit()
except Exception as e:
print('Error', str(e)) # You should see 2 SQLAlchemy errors
access_actionroles table after the script

Expected behavior
The UniqueConstraint key should be respected even if action doesn't have any argument.
Regarding this StackOverflow answer, it should be possible using 2 indexes (one if argument is null, second if argument is not null) : https://stackoverflow.com/a/57647018
Additional context
It should be the same for ActionUsers and ActionSystemRoles
Package version (if known):
1.4.2Describe the bug
It is possible to register multiple
ActionRoleswith same values despite the SQLAlchemyUniqueConstraint(https://github.com/inveniosoftware/invenio-access/blob/master/invenio_access/models.py#L115-L118) ifargumentis None.Steps to Reproduce
access_actionsroles table initial state
access_actionroles table after the script

Expected behavior
The
UniqueConstraintkey should be respected even if action doesn't have any argument.Regarding this StackOverflow answer, it should be possible using 2 indexes (one if argument is null, second if argument is not null) : https://stackoverflow.com/a/57647018
Additional context
It should be the same for
ActionUsersandActionSystemRoles