-
-
Notifications
You must be signed in to change notification settings - Fork 117
Custom User Classes
Shish edited this page Feb 10, 2025
·
2 revisions
User classes can be added to or altered by placing them in
data/config/user-classes.conf.php
.
For example, one can override the default anonymous "allow nothing" permissions like so:
<?php
namespace Shimmie2;
new UserClass("anonymous", "base", [
Permissions::CREATE_COMMENT => True,
Permissions::EDIT_IMAGE_TAG => True,
Permissions::EDIT_IMAGE_SOURCE => True,
Permissions::CREATE_IMAGE_REPORT => True,
]);
For a moderator class, being a regular user who can delete images and comments:
<?php
namespace Shimmie2;
new UserClass("moderator", "user", [
Permissions::DELETE_IMAGE => True,
Permissions::DELETE_COMMENT => True,
]);
For a list of permissions, see core/permissions.php