permissions: refactor permission factory
As done in Invenio-Records-Permissions
for Invenio-App-RDM
, a permission factory should return a Permissions
(set of Needs
and Roles
). Then the need_permission
decorator of invenio-records-rest
would do the check for permissions and accept/reject the request.