diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-12-16 22:49:20 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-12-16 22:49:20 +0100 |
commit | 3db583f5f10a72e53ecd8d282ec5db1e3f4cd4dd (patch) | |
tree | 149a4e9f9dc4a5ffe8090133d1cfcf2013f64ea1 /module/web/pyload/models.py | |
parent | new images (diff) | |
download | pyload-3db583f5f10a72e53ecd8d282ec5db1e3f4cd4dd.tar.xz |
Webinterface authsystem
Diffstat (limited to 'module/web/pyload/models.py')
-rw-r--r-- | module/web/pyload/models.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/module/web/pyload/models.py b/module/web/pyload/models.py index d3d99febc..86962f23c 100644 --- a/module/web/pyload/models.py +++ b/module/web/pyload/models.py @@ -3,13 +3,29 @@ from django.db import models from django.contrib.auth.models import User # Create your models here. -class UserProfile(models.Model): +class Prefs(models.Model): """ Permissions setting """ user = models.ForeignKey(User, unique=True) - template = models.CharField(max_length=30, default='default', null=False, blank=False) + template = models.CharField(max_length=30, default='default', null=False, blank=False) #@TODO: currently unused + + class Meta: + permissions = ( + ('can_see_dl', 'User can see Downloads'), + ('can_change_status', 'User can change Status'), + ('can_download', 'User can download'), + ('can_add', 'User can add Links'), + ('can_delete', 'User can delete Links'), + ('can_see_logs', 'User can see Logs'), + ) + verbose_name = "Preferences" + verbose_name_plural = "Preferences" + + def __unicode__(self): + return "Preferences for %s" % self.user + def user_post_save(sender, instance, **kwargs): - profile, new = UserProfile.objects.get_or_create(user=instance) + profile, new = Prefs.objects.get_or_create(user=instance) models.signals.post_save.connect(user_post_save, User)
\ No newline at end of file |