diff options
| author | Dharmraj Jhala (OpenERP) <dizzy.zala@gmail.com> | 2014-03-28 10:17:41 +0530 |
|---|---|---|
| committer | Dharmraj Jhala (OpenERP) <dizzy.zala@gmail.com> | 2014-03-28 10:17:41 +0530 |
| commit | 0b8e582fac9dfa67c8d9ae330930aafee654c6f6 (patch) | |
| tree | 4e5fa645849329abc0f1d68d0a845afbe2be542a /addons/document_ftp/ftpserver/authorizer.py | |
| parent | fb104246a43b07614730a38ca5da478b3c767845 (diff) | |
| parent | 143a3912afbe4ef21e5af7f108fafb25a11339e4 (diff) | |
[MERGE] with parent branch
bzr revid: dizzy.zala@gmail.com-20140328044741-r2tmeujwibtqpwdb
Diffstat (limited to 'addons/document_ftp/ftpserver/authorizer.py')
| -rw-r--r-- | addons/document_ftp/ftpserver/authorizer.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/addons/document_ftp/ftpserver/authorizer.py b/addons/document_ftp/ftpserver/authorizer.py deleted file mode 100644 index e863eeb39ec..00000000000 --- a/addons/document_ftp/ftpserver/authorizer.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- encoding: utf-8 -*- - -class authorizer: - read_perms = "elr" - write_perms = "adfmw" - - def __init__(self): - self.password = '' - - def validate_authentication(self, username, password): - """Return True if the supplied username and password match the - stored credentials.""" - self.password = password - return True - - def impersonate_user(self, username, password): - """Impersonate another user (noop). - - It is always called before accessing the filesystem. - By default it does nothing. The subclass overriding this - method is expected to provide a mechanism to change the - current user. - """ - - def terminate_impersonation(self): - """Terminate impersonation (noop). - - It is always called after having accessed the filesystem. - By default it does nothing. The subclass overriding this - method is expected to provide a mechanism to switch back - to the original user. - """ - - def has_user(self, username): - """Whether the username exists in the virtual users table.""" - if username=='anonymous': - return False - return True - - def has_perm(self, username, perm, path=None): - """Whether the user has permission over path (an absolute - pathname of a file or a directory). - - Expected perm argument is one of the following letters: - "elradfmw". - """ - paths = path.split('/') - if not len(paths)>2: - return True - db_name = paths[1] - res = security.login(db_name, username, self.password) - return bool(res) - - def get_perms(self, username): - """Return current user permissions.""" - return 'elr' - - def get_home_dir(self, username): - """Return the user's home directory.""" - return '/' - - def get_msg_login(self, username): - """Return the user's login message.""" - return 'Welcome on OpenERP document management system.' - - def get_msg_quit(self, username): - """Return the user's quitting message.""" - return 'Bye.' - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
