On SS 4.0.3 following this guide and the official doc, I successfully created a custom permission role.
Now I would create a custom group and add the default admin to it, as action performed by default in order to maintain those user/group/role settings either if the DB being dropped. I googled around many times but I didn't found any detailed tutorial to achieve this (using the Group
class, the right place to implement this logic and so on).
Could anyone show me the way?
Thanks in advance.
If you want to enforce a data structure you can use DataObject::requireDefaultRecords
. See Group::requireDefaultRecords
for an example of this, it runs on dev/build
every time.
You will want to check whether the data you're creating exists before doing so though, to ensure you don't create the group every time.