- Implemented permission system management inside the game

- changed @chperm to @setperm to avoid confusion with channel commands
- added @setgroup command for adding user group permissions
- Moved permissions/group setup into settings file to allow admins to tweak without going into evennia engine.
- Add all new players to default permission group (defined in settings)
- Defined a basic group hierarchy, removed permission 'genperms.builder' in favour of a group named builders instead, containing all relevant permissions.
- Filtered out all django's automatic permissions in @setperm/list to make permission system more controlled by admin.
- Probably fixed bug that caused new users to not be signed up to channels (more testing needed)
- Added Exception handler in unloggedin method create, this was killing tracebacks upon user creation.
/Griatch
This commit is contained in:
Griatch 2009-10-03 14:40:34 +00:00
parent 77f2186d9a
commit 7f7306a6e4
23 changed files with 341 additions and 214 deletions

View file

@ -2,6 +2,7 @@
Models for the help system.
"""
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User, Group
from src.objects.models import Object
from src.ansi import parse_ansi
@ -22,10 +23,7 @@ class CommChannel(models.Model):
class Meta:
ordering = ['-name']
permissions = (
('emit_commchannel', 'May @cemit over channels.'),
('channel_admin', 'May administer comm channels.')
)
permissions = settings.PERM_CHANNELS
def get_name(self):
"""
@ -113,8 +111,9 @@ class CommChannelMessage(models.Model):
message = models.TextField()
date_sent = models.DateTimeField(editable=False, auto_now_add=True)
class Meta:
ordering = ['-date_sent']
def __str__(self):
return "%s: %s" % (self.channel.name, self.message)
class Meta:
ordering = ['-date_sent']