app/soc/cache/rights.py
changeset 1033 71ff49dbb4b6
child 1070 1ff364d96b02
equal deleted inserted replaced
1032:ed83d42d1ed7 1033:71ff49dbb4b6
       
     1 #!/usr/bin/python2.5
       
     2 #
       
     3 # Copyright 2008 the Melange authors.
       
     4 #
       
     5 # Licensed under the Apache License, Version 2.0 (the "License");
       
     6 # you may not use this file except in compliance with the License.
       
     7 # You may obtain a copy of the License at
       
     8 #
       
     9 #   http://www.apache.org/licenses/LICENSE-2.0
       
    10 #
       
    11 # Unless required by applicable law or agreed to in writing, software
       
    12 # distributed under the License is distributed on an "AS IS" BASIS,
       
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    14 # See the License for the specific language governing permissions and
       
    15 # limitations under the License.
       
    16 
       
    17 """Module contains rights memcache functions.
       
    18 """
       
    19 
       
    20 __authors__ = [
       
    21     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
       
    22   ]
       
    23 
       
    24 
       
    25 from google.appengine.api import memcache
       
    26 
       
    27 
       
    28 RIGHTS = [
       
    29     'checkIsLoggedIn',
       
    30     'checkNotLoggedIn',
       
    31     'checkIsUser',
       
    32     'checkIsDeveloper',
       
    33     'checkCanMakeRequestToGroup',
       
    34     'checkCanCreateFromRequest',
       
    35     'checkCanProcessRequest',
       
    36     'checkIsMyGroupAcceptedRequest',
       
    37     'checkIsHost',
       
    38     'checkIsHostForSponsor',
       
    39     'checkIsClubAdminForClub',
       
    40     'checkIsApplicationAccepted',
       
    41     'checkIsMyNotification',
       
    42     'checkIsMyApplication',
       
    43     'checkIsMyActiveRole',
       
    44     'checkHasPickGetArgs',
       
    45     'checkIsDocumentPublic',
       
    46     ]
       
    47 
       
    48 
       
    49 def flush(id):
       
    50   """Flushes all ACL's for the specified account.
       
    51   """
       
    52 
       
    53   key_prefix = '%s.' % id
       
    54   memcache.delete_multi(RIGHTS, key_prefix=key_prefix)