From 9479e2e8fb7624ec89783badca6e4e510d71680f Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Mon, 25 Oct 2010 00:35:36 +0200 Subject: Simplification of permission system --- permission.py | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) (limited to 'permission.py') diff --git a/permission.py b/permission.py index 310cef2..fe93928 100644 --- a/permission.py +++ b/permission.py @@ -1,45 +1,6 @@ # -*- coding: utf-8 -*- -#TODO : move the globals to a config file (use the config file parser module) -PERM_LIST=['READ','MODIFY','APPEND'] #just add a string here to define a new permission -PERMS = len(PERM_LIST) -MAX = (1< MAX) or (init < 0) : - raise PermissionError('Permission int not in correct range') - result = [] - for shift in range(PERMS-1,-1,-1) : - if init>>shift : - result.append(PERM_LIST[shift]) - init = init-(1<