Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(77)  |  Call(34)  |  Derive(0)  |  Import(43)

src/p/r/prdg.zope.permissions-0.0.1/prdg/zope/permissions.py   prdg.zope.permissions(Download)
        if not security_manager.checkPermission(p, obj):
            raise unauthorized.Unauthorized(
                value=obj, 
                needed={'permission': p}
            )          

src/a/c/AccessControl-3.0.8/src/AccessControl/ImplPython.py   AccessControl(Download)
 
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
from AccessControl.interfaces import ISecurityPolicy
from AccessControl.interfaces import ISecurityManager
                        accessed, container, name, value, context
                        )
                raise Unauthorized(name, value)
 
        containerbase = aq_base(container)
                        'No container provided',
                        accessed, container, name, value, context)
                raise Unauthorized(name, value)
 
            roles = getattr(container, '__roles__', roles)
                                'and the container is not wrapped',
                                accessed, container, name, value, context)
                        raise Unauthorized(name, value)
                else:
                    # Try to acquire roles
                                    'from the container',
                                    accessed, container, name, value, context)
                            raise Unauthorized(name, value)
 
            # We need to make sure that we are allowed to

src/z/o/Zope2-2.13.22/src/OFS/Traversable.py   Zope2(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
from AccessControl.ZopeGuards import guarded_getattr
from Acquisition import Acquired
                    if next is not None:
                        if restricted and not validate(obj, obj, name, next):
                            raise Unauthorized(name)
                        obj = next
                        continue
                            if restricted and not validate(
                                obj, obj, name, next):
                                raise Unauthorized(name)
                        except LocationError:
                            raise AttributeError(name)
                                            guarded_getattr(obj, name, _marker)
                                                is not next):
                                            raise Unauthorized(name)
                        except UseTraversalDefault:
                            # behave as if there had been no '__bobo_traverse__'
                                if restricted and not validate(
                                    obj, obj, None, next):
                                    raise Unauthorized(name)
 
                except (AttributeError, NotFound, KeyError), e:

src/z/o/Zope-HEAD/src/OFS/Traversable.py   Zope(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
from AccessControl.ZopeGuards import guarded_getattr
from Acquisition import Acquired
                    if next is not None:
                        if restricted and not validate(obj, obj, name, next):
                            raise Unauthorized(name)
                        obj = next
                        continue
                            if restricted and not validate(
                                obj, obj, name, next):
                                raise Unauthorized(name)
                        except LocationError:
                            raise AttributeError(name)
                                            guarded_getattr(obj, name, _marker)
                                                is not next):
                                            raise Unauthorized(name)
                        except UseTraversalDefault:
                            # behave as if there had been no '__bobo_traverse__'
                                if restricted and not validate(
                                    obj, obj, None, next):
                                    raise Unauthorized(name)
 
                except (AttributeError, NotFound, KeyError), e:

src/r/a/raptus.multilanguageurls-1.0a8/raptus/multilanguageurls/patches.py   raptus.multilanguageurls(Download)
from BTrees.OOBTree import OOBTree
from BTrees.IOBTree import IOBTree
 
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
                if next is not None:
                    if restricted and not validate(obj, obj, name, next):
                        raise Unauthorized(name)
                    obj = next
                    continue
                        if restricted and not validate(
                            obj, obj, name, next):
                            raise Unauthorized(name)
                    except TraversalError:
                        raise AttributeError(name)
                                guarded_getattr(obj, name, _marker)
                                    is not next):
                                raise Unauthorized(name)
                else:
                    if getattr(aq_base(obj), name, _marker) is not _marker:
                        if restricted and not validate(
                            obj, obj, None, next):
                            raise Unauthorized(name)
 
            except (AttributeError, NotFound, KeyError), e:

src/z/o/Zope2-2.13.22/src/Shared/DC/Scripts/Bindings.py   Zope2(Download)
 
 
from AccessControl.unauthorized import Unauthorized
 
class UnauthorizedBinding:
    def __you_lose(self):
        name = self.__dict__['_name']
        raise Unauthorized('Not authorized to access binding: %s' % name)
 
    __str__ = __call__ = index_html = __you_lose

src/p/r/Products.DCWorkflow-2.3.0-beta/Products/DCWorkflow/DCWorkflow.py   Products.DCWorkflow(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
from Acquisition import aq_inner
from Acquisition import aq_parent
            raise WorkflowException(_(u'Object is in an undefined state.'))
        if action not in sdef.transitions:
            raise Unauthorized(action)
        tdef = self.transitions.get(action, None)
        if tdef is None or tdef.trigger_type != TRIGGER_USER_ACTION:
            msg = _(u"Transition '${action_id}' is not triggered by a user "
                    u"action.", mapping={'action_id': action})
            raise WorkflowException(msg)
        if not self._checkTransitionGuard(tdef, ob, **kw):
            raise Unauthorized(action)

src/z/o/Zope-HEAD/src/Shared/DC/Scripts/Bindings.py   Zope(Download)
 
 
from AccessControl.unauthorized import Unauthorized
 
class UnauthorizedBinding:
    def __you_lose(self):
        name = self.__dict__['_name']
        raise Unauthorized('Not authorized to access binding: %s' % name)
 
    __str__ = __call__ = index_html = __you_lose

src/z/o/Zope2-2.13.22/src/OFS/owner.py   Zope2(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
 
 
        if (want_referer != got_referer or security.calledByExecutable()):
            raise Unauthorized(
                'manage_takeOwnership was called from an invalid context')
 
        self.changeOwnership(security.getUser(), recursive)

src/z/o/Zope-HEAD/src/OFS/owner.py   Zope(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.unauthorized import Unauthorized
 
 
        if (want_referer != got_referer or security.calledByExecutable()):
            raise Unauthorized(
                'manage_takeOwnership was called from an invalid context')
 
        self.changeOwnership(security.getUser(), recursive)

  1 | 2 | 3 | 4 | 5  Next