Since bitmasks of user roles and access levels are generated on the fly, they can differ if items in their respective arrays are moved around. This can become a huge problem if a user's role (the Number value) is persisted to the database, then the array items are moved around, leading to each role getting a different bitmask from what has previously been stored in the database. This can be rectified by storing the String value of the role (or some other kind of unique identifier) instead of the Number value.
Since bitmasks of user roles and access levels are generated on the fly, they can differ if items in their respective arrays are moved around. This can become a huge problem if a user's role (the Number value) is persisted to the database, then the array items are moved around, leading to each role getting a different bitmask from what has previously been stored in the database. This can be rectified by storing the String value of the role (or some other kind of unique identifier) instead of the Number value.