Shows ACL for the specified service.
189390
def access_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:view', **{
        'unicorn': ctx.repo.create_secure_service('unicorn'),
        'service': name,
    })
1158611
def set_def_acl(self, acl_or_str, key_name='', headers=None):
        """"""
        if isinstance(acl_or_str, Policy):
            raise InvalidAclError('Attempt to set S3 Policy on GS ACL')
        elif isinstance(acl_or_str, ACL):
            self.set_def_xml_acl(acl_or_str.to_xml(), key_name, headers=headers)
        else:
            self.set_def_canned_acl(acl_or_str, key_name, headers=headers)
974923
def _GetAccessToken(self):
    """"""
    service_accounts = self.watcher.GetMetadata(metadata_key=self.metadata_key)
    try:
      return service_accounts[self.service_account]['token']['access_token']
    except KeyError:
      return None
423429
def set_def_xml_acl(self, acl_str, key_name='', headers=None):
        """"""
        return self.set_xml_acl(acl_str, key_name, headers, 
                                query_args=DEF_OBJ_ACL)
928467
def put_object_acl(self, bucket, object_name, access_control_policy):
        
        data = access_control_policy.to_xml()
        details = self._details(
            method=b"PUT",
            url_context=self._url_context(
                bucket=bucket, object_name='%s?acl' % (object_name,),
            ),
            body=data,
        )
        query = self._query_factory(details)
        d = self._submit(query)
        d.addCallback(self._parse_acl)
        return d
930709
def build_acl_port(self, port, enabled=True):
        " "
        if port is not None:
            if ':' in port:
                range = port.replace(':', ' ')
                acl = "range %(range)s " % {'range': range}
            else:
                acl = "eq %(port)s " % {'port': port}
                if not enabled:
                    acl += "inactive"
            return acl
384072
def get_acl_on(request):
    
    acl_on = settings.ACL_ON
    if settings.LOCKDOWN and hasattr(request, 'user'):
        # ACL is always disabled for superusers
        if request.user.is_superuser:
            acl_on = False
    return acl_on
420716
def meth_acl(args):
    ''' '''
    r = fapi.get_repository_method_acl(args.namespace, args.method,
                                                    args.snapshot_id)
    fapi._check_response_code(r, 200)
    acls = sorted(r.json(), key=lambda k: k['user'])
    return map(lambda acl: '{0}\t{1}'.format(acl['user'], acl['role']), acls)
1285255
def acls(self):
        """"""
        if self._acls is None:
            self._acls = InstanceAcls(instance=self)
        return self._acls
1284385
def get_acl_helper(self, key_name, headers, query_args):
        """"""
        response = self.connection.make_request('GET', self.name, key_name,
                                                query_args=query_args, 
                                                headers=headers)
        body = response.read()
        if response.status == 200:
            acl = ACL(self)
            h = handler.XmlHandler(acl, self)
            xml.sax.parseString(body, h)
            return acl
        else:
            raise self.connection.provider.storage_response_error(
                response.status, response.reason, body)
687731
Map<CmsUUID, CmsAccessControlEntry> buildAceMap(Collection<CmsAccessControlEntry> acl) {

        if (acl == null) {
            acl = new ArrayList<>();
        }
        Map<CmsUUID, CmsAccessControlEntry> result = new HashMap<>();
        for (CmsAccessControlEntry ace : acl) {
            result.put(ace.getPrincipal(), ace);
        }
        return result;
    }
555981
def item_acl(self, item):
        
        if self.es_based:
            from nefertari_guards.elasticsearch import get_es_item_acl
            return get_es_item_acl(item)
        return super(DatabaseACLMixin, self).item_acl(item)
738469
def get_bucket_acl(self, bucket):
        
        details = self._details(
            method=b"GET",
            url_context=self._url_context(bucket=bucket, object_name="?acl"),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(self._parse_acl)
        return d
278406
def show_rbac_policy(self, rbac_policy_id, **_params):
        """"""
        return self.get(self.rbac_policy_path % rbac_policy_id,
                        params=_params)
682297
def meth_set_acl(args):
    
    acl_updates = [{"user": user, "role": args.role} \
                   for user in set(expand_fc_groups(args.users)) \
                   if user != fapi.whoami()]

    id = args.snapshot_id
    if not id:
        # get the latest snapshot_id for this method from the methods repo
        r = fapi.list_repository_methods(namespace=args.namespace,
                                         name=args.method)
        fapi._check_response_code(r, 200)
        versions = r.json()
        if len(versions) == 0:
            if fcconfig.verbosity:
                eprint("method {0}/{1} not found".format(args.namespace,
                                                         args.method))
            return 1
        latest = sorted(versions, key=lambda m: m['snapshotId'])[-1]
        id = latest['snapshotId']

    r = fapi.update_repository_method_acl(args.namespace, args.method, id,
                                          acl_updates)
    fapi._check_response_code(r, 200)
    if fcconfig.verbosity:
        print("Updated ACL for {0}/{1}:{2}".format(args.namespace, args.method,
                                                   id))
    return 0
1261189
def do_access_control(self):
        """"""
        from abilian.services import get_service

        if current_app.testing and current_app.config.get("NO_LOGIN"):
            # Special case for tests
            user = User.query.get(0)
            login_user(user, force=True)
            return

        state = self.app_state
        user = unwrap(current_user)

        # Another special case for tests
        if current_app.testing and getattr(user, "is_admin", False):
            return

        security = get_service("security")
        user_roles = frozenset(security.get_roles(user))
        endpoint = request.endpoint
        blueprint = request.blueprint

        access_controllers = []
        access_controllers.extend(state.bp_access_controllers.get(None, []))

        if blueprint and blueprint in state.bp_access_controllers:
            access_controllers.extend(state.bp_access_controllers[blueprint])

        if endpoint and endpoint in state.endpoint_access_controllers:
            access_controllers.extend(state.endpoint_access_controllers[endpoint])

        for access_controller in reversed(access_controllers):
            verdict = access_controller(user=user, roles=user_roles)
            if verdict is None:
                continue
            elif verdict is True:
                return
            else:
                if user.is_anonymous:
                    return self.redirect_to_login()
                raise Forbidden()

        # default policy
        if current_app.config.get("PRIVATE_SITE") and user.is_anonymous:
            return self.redirect_to_login()
1369903
public function hasAcl()
    {
        if ($this->acl instanceof Acl\Acl
            || static::$defaultAcl instanceof Acl\Acl
        ) {
            return true;
        }

        return false;
    }