def _privileged(original):
 @wraps(original)
 def permissionChecker(self, *args, **kwargs):
  if (original.__name__ not in self.permissions):
   raise IOError(EPERM, 'Operation not permitted')
  return original(self, *args, **kwargs)
 return permissionChecker

def _privileged ( original ) : @ wraps ( original ) def permissionChecker ( self , * args , ** kwargs ) : if ( original . __name__ not in self . permissions ) : raise IOError ( EPERM , 'Operation not permitted' ) return original ( self , * args , ** kwargs ) return permissionChecker
wrap a l{memoryiosystem} method with permission-checking logic .