Retrieve access control list for given version of a repository method
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)
832788
public synchronized Acl getAcl(CmsCmisCallContext context, String objectId, boolean onlyBasicPermissions) {

        try {

            CmsObject cms = m_repository.getCmsObject(context);
            CmsUUID structureId = new CmsUUID(objectId);
            CmsResource resource = cms.readResource(structureId);
            return collectAcl(cms, resource, onlyBasicPermissions);
        } catch (CmsException e) {
            handleCmsException(e);
            return null;
        }

    }
944644
def get_version_data():
    """"""
    connect_str = str(settings.CFG["db"]["connect_string"])
    repo_url = path.template_path("../db/")
    return (connect_str, repo_url)
128813
private static List<MethodInfo> getPublicMethodInfos(final JavaClass cls) {
        List<MethodInfo> methodInfos = new ArrayList<>();
        Method[] methods = cls.getMethods();
        for (Method m : methods) {
            if ((m.getAccessFlags() & (Const.ACC_PUBLIC | Const.ACC_PROTECTED)) != 0) {
                ExceptionTable et = m.getExceptionTable();
                methodInfos
                        .add(new MethodInfo(m.getName(), m.getSignature(), et == null ? null : et.getExceptionNames()));
            }
        }
        return methodInfos;
    }
440501
def get_permissions(cls):
        
        perms = []
        for kls_name, kls in cls.registry.items():
            for method_name in cls.__dict__.keys():
                if method_name.endswith('_view'):
                    perms.append("%s.%s" % (kls_name, method_name))
        return perms
841232
public String retrieveReferenceList()
    {
        try 
        {
            references = gpUtil.getReferences(spaceKey, getPage().getTitle());
            if(isEditMode)
            {
                repositories = gpUtil.getRepositories(spaceKey);
                if(repositories.isEmpty())
                    throw new GreenPepperServerException("greenpepper.server.repositoriesnotfound", "");
                
                projectSystemUnderTests = gpUtil.getSystemsUnderTests(spaceKey);
                if(projectSystemUnderTests.isEmpty())
                    throw new GreenPepperServerException("greenpepper.server.sutsnotfound", "");
            }
        } 
        catch (GreenPepperServerException e) 
        {
            addActionError(e.getId());
            isEditMode = false;
        }

        return SUCCESS;
    }
1296678
def get_branches_permissions(self, project, repository, limit=25):
        
        url = 'rest/branch-permissions/2.0/projects/{project}/repos/{repository}/restrictions'.format(project=project,
                                                                                                      repository=repository)
        params = {}
        if limit:
            params['limit'] = limit
        return self.get(url, params=params)
1273323
def get_repo_info(loader, sha, prov_g):
    """"""
    user_repo = loader.getFullName()
    repo_title = loader.getRepoTitle()
    contact_name = loader.getContactName()
    contact_url = loader.getContactUrl()
    commit_list = loader.getCommitList()
    licence_url = loader.getLicenceURL()

    # Add the API URI as a used entity by the activity
    if prov_g:
        prov_g.add_used_entity(loader.getRepoURI())

    prev_commit = None
    next_commit = None
    version = sha if sha else commit_list[0]
    if commit_list.index(version) < len(commit_list) - 1:
        prev_commit = commit_list[commit_list.index(version) + 1]
    if commit_list.index(version) > 0:
        next_commit = commit_list[commit_list.index(version) - 1]

    info = {
        'version': version,
        'title': repo_title,
        'contact': {
            'name': contact_name,
            'url': contact_url
        },
        'license': {
            'name': 'License',
            'url': licence_url
        }
    }

    basePath = '/api/' + user_repo + '/'
    basePath += ('commit/' + sha + '/') if sha else ''

    return prev_commit, next_commit, info, basePath
567577
def get_repositories(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('repository_lookup_session').get_repositories()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Repository(self._provider_manager, cat, self._runtime, self._proxy))
        return RepositoryList(cat_list)
566153
@Override
    public RepositoryInfo describeRepository(Context context)
            throws ServerException {
        m_authorizationModule.enforceDescribeRepository(context);
        RepositoryInfo repositoryInfo = new RepositoryInfo();
        repositoryInfo.repositoryName =
                getServer().getParameter("repositoryName");
        String reposBaseURL =
                getReposBaseURL(context
                                        .getEnvironmentValue(Constants.HTTP_REQUEST.SECURITY.attributeId)
                                        .equals(Constants.HTTP_REQUEST.SECURE.uri) ? "https"
                                                                                   : "http",
                                context
                                        .getEnvironmentValue(Constants.HTTP_REQUEST.SERVER_PORT.attributeId));
        repositoryInfo.repositoryBaseURL =
                reposBaseURL + "/" + context.getEnvironmentValue(Constants.FEDORA_APP_CONTEXT_NAME);

        repositoryInfo.repositoryVersion = Server.VERSION;
        Module domgr = getServer().getModule("org.fcrepo.server.storage.DOManager");
        repositoryInfo.repositoryPIDNamespace =
                domgr.getParameter("pidNamespace");
        repositoryInfo.defaultExportFormat =
                domgr.getParameter("defaultExportFormat");
        repositoryInfo.OAINamespace = m_repositoryDomainName;
        repositoryInfo.adminEmailList = getAdminEmails();
        repositoryInfo.samplePID =
                repositoryInfo.repositoryPIDNamespace + ":100";
        repositoryInfo.sampleOAIIdentifer =
                "oai:" + repositoryInfo.OAINamespace + ":"
                + repositoryInfo.samplePID;
        repositoryInfo.sampleSearchURL =
                repositoryInfo.repositoryBaseURL + "/objects";
        repositoryInfo.sampleAccessURL =
                repositoryInfo.repositoryBaseURL + "/objects/" + "demo:5"; // PID should be URL-encoded, but nothing to encode in this case
        repositoryInfo.sampleOAIURL =
                repositoryInfo.repositoryBaseURL + "/oai?verb=Identify";
        repositoryInfo.retainPIDs = getRetainPIDs();
        return repositoryInfo;
    }
234
def access_storage_list(**kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:storage:list', **{
        'storage': ctx.repo.create_secure_service('storage'),
    })
535991
def list_entitlements_options(f):
    """"""

    @common_entitlements_options
    @decorators.common_cli_config_options
    @decorators.common_cli_list_options
    @decorators.common_cli_output_options
    @decorators.common_api_auth_options
    @decorators.initialise_api
    @click.argument(
        "owner_repo", metavar="OWNER/REPO", callback=validators.validate_owner_repo
    )
    @click.pass_context
    @functools.wraps(f)
    def wrapper(ctx, *args, **kwargs):
        # pylint: disable=missing-docstring
        return ctx.invoke(f, *args, **kwargs)

    return wrapper
1337072
def get_list_filter(self, request):
        
        list_filter = super(VersionedAdmin, self).get_list_filter(request)
        return list(list_filter) + [('version_start_date', DateTimeFilter),
                                    IsCurrentFilter]
534299
def to_api_repr(self):
        
        resource = {}

        if self.etag is not None:
            resource["etag"] = self.etag

        if self.version is not None:
            resource["version"] = self.version

        if self._bindings:
            bindings = resource["bindings"] = []
            for role, members in sorted(self._bindings.items()):
                if members:
                    bindings.append({"role": role, "members": sorted(set(members))})

            if not bindings:
                del resource["bindings"]

        return resource
813053
def list_rbac_policies(self, retrieve_all=True, **_params):
        """"""
        return self.list('rbac_policies', self.rbac_policies_path,
                         retrieve_all, **_params)
1366685
def ParseYAMLAuthorizationsList(yaml_data):
    """"""
    try:
      raw_list = yaml.ParseMany(yaml_data)
    except (ValueError, pyyaml.YAMLError) as e:
      raise InvalidAPIAuthorization("Invalid YAML: %s" % e)

    result = []
    for auth_src in raw_list:
      auth = APIAuthorization()
      auth.router_cls = _GetRouterClass(auth_src["router"])
      auth.users = auth_src.get("users", [])
      auth.groups = auth_src.get("groups", [])
      auth.router_params = auth_src.get("router_params", {})

      result.append(auth)

    return result
1298623
@Override
	protected File[] listRepositoryFiles() {
		FileFilter textLogFilter = new FileFilter() {
			@Override
			public boolean accept(File pathname) {
				return pathname.getName().startsWith(TEXTLOGPREF) && pathname.getName().endsWith(TEXTLOGEXT);
			}
		};
		return AccessHelper.listFiles(repositoryLocation, textLogFilter);
	}