[ckan-changes] commit/ckan: kindly: [auth] add sysadmins

Bitbucket commits-noreply at bitbucket.org
Thu Jun 23 16:16:03 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/1bc1156f321b/
changeset:   1bc1156f321b
branch:      feature-1094-authz
user:        kindly
date:        2011-06-23 18:13:14
summary:     [auth] add sysadmins
affected #:  2 files (234 bytes)

--- a/ckan/migration/versions/041_auth_refactor.py	Thu Jun 23 16:12:32 2011 +0100
+++ b/ckan/migration/versions/041_auth_refactor.py	Thu Jun 23 17:13:14 2011 +0100
@@ -14,6 +14,9 @@
 --DROP TABLE system_role;
 BEGIN;
 
+alter table "user" add column sysadmin bool;
+update "user" set sysadmin = (select true from user_object_role where context = 'System' and role = 'admin' and user_object_role.user_id = "user".id);
+
 alter table group_role drop constraint group_role_group_id_fkey;
 alter table package_role drop constraint package_role_package_id_fkey;
 alter table user_object_role drop constraint  user_object_role_authorized_group_id_fkey;


--- a/ckan/model/user.py	Thu Jun 23 16:12:32 2011 +0100
+++ b/ckan/model/user.py	Thu Jun 23 17:13:14 2011 +0100
@@ -19,6 +19,7 @@
         Column('apikey', UnicodeText, default=make_uuid),
         Column('created', DateTime, default=datetime.now),
         Column('about', UnicodeText),
+        Column('sysadmin', Boolean),
         )
 
 class User(DomainObject):

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list