Replace role strings in session by constants
Description
In order to remove Flourish (see #999) the session handling needs to be replaced, for example with Symfony sessions. Currently there is the problem that we are using strings to specify the role, like "fs", "bot", etc. These strings are using when checking for a role with session->may
, but they are also stored in the Flourish backend.
I would propose:
- get rid of the string constants
- replace them with the Role integer constants that we already have, i.e.
session->may('fs')
becomessession->may(Role::FOODSAVER)
- let the session class handle the mapping between the integer constants and the backend
This would decouple our code from whatever backend the session class uses and we can easily switch from Flourish to Symfony or anything else. This does, however, require to change many files, which can only really be done when it does not create merge conflicts.
Changing in permission classes (src/Permissions) from may
to mayRole
-
BasketPermissions -
BlogPermissions -
ContentPermissions -
EventPermissions -
FoodsharPointPermissions -
ForumPermissions -
MailboxPermissions -
NewsletterEMailPermissions -
ProfilePermissions -
QuizPermissions -
RegionPermissions -
ReportPermissions -
SearchPermissions -
SettingsPermissions -
StorePermissions -
UserPermissions -
VotingPermissions -
WallPostPermissions -
WorkgroupPermissions
Edited by -