code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Nullable
public NamedPullRequestQuery getPullRequestQuery(String name) {
for (var query: getPullRequestQueries()) {
if (query.getName().equals(name))
return query;
}
return null;
} | Set password of this user.
@param password
password to set | getPullRequestQuery | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public LinkedHashMap<String, Boolean> getPullRequestQueryWatches() {
return pullRequestQueryWatches;
} | Set password of this user.
@param password
password to set | getPullRequestQueryWatches | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public void setPullRequestQueryWatches(LinkedHashMap<String, Boolean> pullRequestQueryWatches) {
this.pullRequestQueryWatches = pullRequestQueryWatches;
} | Set password of this user.
@param password
password to set | setPullRequestQueryWatches | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public ArrayList<NamedBuildQuery> getBuildQueries() {
return buildQueries;
} | Set password of this user.
@param password
password to set | getBuildQueries | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public void setBuildQueries(ArrayList<NamedBuildQuery> buildQueries) {
this.buildQueries = buildQueries;
} | Set password of this user.
@param password
password to set | setBuildQueries | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
@Nullable
public NamedBuildQuery getBuildQuery(String name) {
for (var query: getBuildQueries()) {
if (query.getName().equals(name))
return query;
}
return null;
} | Set password of this user.
@param password
password to set | getBuildQuery | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public ArrayList<NamedPackQuery> getPackQueries() {
return packQueries;
} | Set password of this user.
@param password
password to set | getPackQueries | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public void setPackQueries(ArrayList<NamedPackQuery> packQueries) {
this.packQueries = packQueries;
} | Set password of this user.
@param password
password to set | setPackQueries | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
@Nullable
public NamedPackQuery getPackQuery(String name) {
for (var query: getPackQueries()) {
if (query.getName().equals(name))
return query;
}
return null;
} | Set password of this user.
@param password
password to set | getPackQuery | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public LinkedHashSet<String> getBuildQuerySubscriptions() {
return buildQuerySubscriptions;
} | Set password of this user.
@param password
password to set | getBuildQuerySubscriptions | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public void setBuildQuerySubscriptions(LinkedHashSet<String> buildQuerySubscriptions) {
this.buildQuerySubscriptions = buildQuerySubscriptions;
} | Set password of this user.
@param password
password to set | setBuildQuerySubscriptions | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public LinkedHashSet<String> getPackQuerySubscriptions() {
return packQuerySubscriptions;
} | Set password of this user.
@param password
password to set | getPackQuerySubscriptions | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public void setPackQuerySubscriptions(LinkedHashSet<String> packQuerySubscriptions) {
this.packQuerySubscriptions = packQuerySubscriptions;
} | Set password of this user.
@param password
password to set | setPackQuerySubscriptions | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public boolean isEnforce2FA() {
return OneDev.getInstance(SettingManager.class).getSecuritySetting().isEnforce2FA()
|| getGroups().stream().anyMatch(it->it.isEnforce2FA());
} | Set password of this user.
@param password
password to set | isEnforce2FA | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public List<EmailAddress> getSortedEmailAddresses() {
if (sortedEmailAddresses == null) {
sortedEmailAddresses = new ArrayList<>(getEmailAddresses());
Collections.sort(sortedEmailAddresses);
}
return sortedEmailAddresses;
} | Set password of this user.
@param password
password to set | getSortedEmailAddresses | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
private EmailAddressManager getEmailAddressManager() {
return OneDev.getInstance(EmailAddressManager.class);
} | Set password of this user.
@param password
password to set | getEmailAddressManager | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
@Nullable
public EmailAddress getPrimaryEmailAddress() {
if (primaryEmailAddress == null)
primaryEmailAddress = Optional.ofNullable(getEmailAddressManager().findPrimary(this));
return primaryEmailAddress.orElse(null);
} | Set password of this user.
@param password
password to set | getPrimaryEmailAddress | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
@Nullable
public EmailAddress getGitEmailAddress() {
if (gitEmailAddress == null)
gitEmailAddress = Optional.ofNullable(getEmailAddressManager().findGit(this));
return gitEmailAddress.orElse(null);
} | Set password of this user.
@param password
password to set | getGitEmailAddress | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
@Nullable
public EmailAddress getPublicEmailAddress() {
if (publicEmailAddress == null)
publicEmailAddress = Optional.ofNullable(getEmailAddressManager().findPublic(this));
return publicEmailAddress.orElse(null);
} | Set password of this user.
@param password
password to set | getPublicEmailAddress | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
@Override
public UserFacade getFacade() {
return new UserFacade(getId(), getName(), getFullName(), isServiceAccount(), isDisabled());
} | Set password of this user.
@param password
password to set | getFacade | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/User.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/User.java | MIT |
public boolean isReviewRequiredForModification(@Nullable String file) {
ReviewRequirement requirement = getParsedReviewRequirement();
if (!requirement.getUsers().isEmpty() || !requirement.getGroups().isEmpty())
return true;
if (file != null) {
requirement = getFileProtection(file).getParsedReviewRequire... | Check if specified user can modify specified file in specified branch.
@param file
file to be checked
@return
result of the check. | isReviewRequiredForModification | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/support/code/BranchProtection.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/support/code/BranchProtection.java | MIT |
public boolean canModifyBuildSpecRoughly(User user) {
ReviewRequirement requirement = getParsedReviewRequirement();
if (!requirement.canBeSatisfiedByUserRoughly(user))
return false;
requirement = getFileProtection(BuildSpec.BLOB_PATH).getParsedReviewRequirement();
return requirement.canBeSatisfiedByUserRough... | Check if specified user can modify specified file in specified branch.
@param file
file to be checked
@return
result of the check. | canModifyBuildSpecRoughly | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/support/code/BranchProtection.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/support/code/BranchProtection.java | MIT |
public boolean isBuildRequiredForModification(@Nullable String file) {
return !getJobNames().isEmpty() || file != null && !getFileProtection(file).getJobNames().isEmpty();
} | Check if specified user can modify specified file in specified branch.
@param file
file to be checked
@return
result of the check. | isBuildRequiredForModification | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/model/support/code/BranchProtection.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/model/support/code/BranchProtection.java | MIT |
public Criteria getExecutableCriteria(Session session) {
CriteriaImpl clone = (CriteriaImpl) SerializationUtils.clone(impl);
clone.setSession( ( SessionImplementor ) session );
return clone;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | getExecutableCriteria | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public static <T extends AbstractEntity> EntityCriteria<T> of(Class<T> clazz) {
return new EntityCriteria<T>(clazz.getName());
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | of | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public static <T extends AbstractEntity> EntityCriteria<T> of(Class<T> clazz, String alias) {
return new EntityCriteria<T>(clazz.getName(), alias );
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | of | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> add(Criterion criterion) {
criteria.add(criterion);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | add | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> addOrder(Order order) {
criteria.addOrder(order);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | addOrder | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> createAlias(String associationPath, String alias)
throws HibernateException {
criteria.createAlias(associationPath, alias);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createAlias | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public Criteria createCriteria(String associationPath, String alias)
throws HibernateException {
return criteria.createCriteria(associationPath, alias);
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createCriteria | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public Criteria createCriteria(String associationPath)
throws HibernateException {
return criteria.createCriteria(associationPath);
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createCriteria | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public String getAlias() {
return criteria.getAlias();
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | getAlias | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> setFetchMode(String associationPath, FetchMode mode)
throws HibernateException {
criteria.setFetchMode(associationPath, mode);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | setFetchMode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> setProjection(Projection projection) {
criteria.setProjection(projection);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | setProjection | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> setResultTransformer(ResultTransformer resultTransformer) {
criteria.setResultTransformer(resultTransformer);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | setResultTransformer | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public String toString() {
return "DetachableCriteria(" + criteria.toString() + ')';
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | toString | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
CriteriaImpl getCriteriaImpl() {
return impl;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | getCriteriaImpl | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> createAlias(String associationPath, String alias, JoinType joinType) throws HibernateException {
criteria.createAlias(associationPath, alias, joinType);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createAlias | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> createAlias(String associationPath, String alias, JoinType joinType, Criterion withClause) throws HibernateException {
criteria.createAlias(associationPath, alias, joinType, withClause);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createAlias | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> createCriteria(String associationPath, JoinType joinType) throws HibernateException {
return new EntityCriteria<T>(impl, criteria.createCriteria(associationPath, joinType));
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createCriteria | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> createCriteria(String associationPath, String alias, JoinType joinType) throws HibernateException {
return new EntityCriteria<T>(impl, criteria.createCriteria(associationPath, alias, joinType));
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createCriteria | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> createCriteria(String associationPath, String alias, JoinType joinType, Criterion withClause) throws HibernateException {
return new EntityCriteria<T>(impl, criteria.createCriteria(associationPath, alias, joinType, withClause));
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | createCriteria | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> setComment(String comment) {
criteria.setComment(comment);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | setComment | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> setLockMode(LockMode lockMode) {
criteria.setLockMode(lockMode);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | setLockMode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public EntityCriteria<T> setLockMode(String alias, LockMode lockMode) {
criteria.setLockMode(alias, lockMode);
return this;
} | Get an executable instance of <literal>Criteria</literal>,
to actually run the query. | setLockMode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/persistence/dao/EntityCriteria.java | MIT |
public Query asLuceneQuery() throws TooGeneralQueryException {
BooleanQuery.Builder luceneQueryBuilder = new BooleanQuery.Builder();
String directory = this.directory;
if (directory != null) {
if (!directory.endsWith("/"))
directory += "/";
luceneQueryBuilder.add(new WildcardQuery(BLOB_PATH.getTerm(d... | Get lucene query representation of this query
@return
lucene query
@throws
TooGeneralQueryException if supplied query term is too general to possibly cause query slow | asLuceneQuery | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/BlobQuery.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/BlobQuery.java | MIT |
@Nullable
public String getLiteral() {
return literal;
} | Construct a leaf literal.
@param literal
string literal that must occur, or empty string to indicate an empty occurrence,
or <tt>null</tt> to indicate an opaque occurrence | getLiteral | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LeafLiterals.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LeafLiterals.java | MIT |
@Override
public List<List<LeafLiterals>> flattern(boolean outmost) {
List<List<LeafLiterals>> rows = new ArrayList<>();
rows.add(new ArrayList<LeafLiterals>());
rows.get(0).add(this);
return rows;
} | Construct a leaf literal.
@param literal
string literal that must occur, or empty string to indicate an empty occurrence,
or <tt>null</tt> to indicate an opaque occurrence | flattern | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LeafLiterals.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LeafLiterals.java | MIT |
public static void trim(List<List<LeafLiterals>> rows, boolean outmost) {
Set<Integer> trimmed = new HashSet<>();
int index1 = 0;
for (List<LeafLiterals> row1: rows) {
int index2 = 0;
for (List<LeafLiterals> row2: rows) {
if (!trimmed.contains(index1) && !trimmed.contains(index2) && index1!=index2) {... | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | trim | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
private static boolean covers(List<LeafLiterals> row1, List<LeafLiterals> row2) {
boolean covers = true;
for (LeafLiterals literals: row2) {
if (!covers(row1, literals)) {
covers = false;
break;
}
}
return covers;
} | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | covers | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
private static boolean covers(List<LeafLiterals> row, LeafLiterals leaf) {
if (leaf.getLiteral() != null) {
boolean covers = false;
for (LeafLiterals each: row) {
if (each.getLiteral() != null && each.getLiteral().contains(leaf.getLiteral())) {
covers = true;
break;
}
}
return covers;
... | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | covers | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
@Nullable
private static String getPrefix(List<LeafLiterals> row, boolean mustBeforeOpaque) {
int firstOpaqueIndex = getFirstOpaqueIndex(row);
if (firstOpaqueIndex == -1) {
if (mustBeforeOpaque)
return null;
else if (row.size() == 0)
return "";
else if (row.size() == 1)
return Preconditions.ch... | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | getPrefix | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
@Nullable
private static String getSuffix(List<LeafLiterals> row, boolean mustAfterOpaque) {
int lastOpaqueIndex = getLastOpaqueIndex(row);
if (lastOpaqueIndex == -1) {
if (mustAfterOpaque)
return null;
else if (row.size() == 0)
return "";
else if (row.size() == 1)
return Preconditions.checkNo... | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | getSuffix | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
private static int getFirstOpaqueIndex(List<LeafLiterals> row) {
for (int i=0; i<row.size(); i++) {
if (row.get(i).getLiteral() == null)
return i;
}
return -1;
} | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | getFirstOpaqueIndex | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
private static int getLastOpaqueIndex(List<LeafLiterals> row) {
for (int i=row.size()-1; i>=0; i--) {
if (row.get(i).getLiteral() == null)
return i;
}
return -1;
} | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | getLastOpaqueIndex | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
private static List<LeafLiterals> getMiddle(List<LeafLiterals> row) {
int firstOpaqueIndex = getFirstOpaqueIndex(row);
int lastOpaqueIndex = getLastOpaqueIndex(row);
if (firstOpaqueIndex != lastOpaqueIndex)
return row.subList(firstOpaqueIndex+1, lastOpaqueIndex);
else
return new ArrayList<>();
} | Trim unnecessary rows in specified row. For instance, considering below rows:
<li>a & b
<li>ac & bd
The first row states that both 'a' and 'b' should occur, and the second row
states that 'ab' should occur. Combination of these two rows states that one
of the two rows should occur. When <tt>outmost</tt> is true, we... | getMiddle | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
public static List<LeafLiterals> merge(List<LeafLiterals> row, boolean outmost) {
List<LeafLiterals> mergedRow = new ArrayList<>();
LeafLiterals merging = null;
for (LeafLiterals leaf: row) {
if (leaf.getLiteral() != null) {
if (merging == null) {
merging = new LeafLiterals(leaf.getLiteral());
... | Merge specified list of leaf literals to concatenate continuous non-opaque literals.
@param row
@return
list of merged literals | merge | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/LiteralUtils.java | MIT |
public Query asNGramQuery(String fieldName, int gramSize) throws TooGeneralQueryException {
BooleanQuery.Builder orQueryBuilder = new BooleanQuery.Builder();
for (List<LeafLiterals> row: rows) {
BooleanQuery.Builder andQueryBuilder = new BooleanQuery.Builder();
for (LeafLiterals literals: row) {
if (liter... | @param fieldName
@param gramSize
@return
@throws TooGeneralQueryException | asNGramQuery | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/RegexLiterals.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/RegexLiterals.java | MIT |
@Override
public String toString() {
StringBuilder orBuilder = new StringBuilder();
for (List<LeafLiterals> row: rows) {
StringBuilder andBuilder = new StringBuilder();
for (LeafLiterals literals: row) {
if (!Strings.isNullOrEmpty(literals.getLiteral())) {
if (andBuilder.length() != 0)
andBui... | @param fieldName
@param gramSize
@return
@throws TooGeneralQueryException | toString | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/RegexLiterals.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/RegexLiterals.java | MIT |
@Override
public void syntaxError(Recognizer<?, ?> recognizer,
Object offendingSymbol,
int line,
int charPositionInLine,
String msg,
RecognitionException e) {
logger.error("line " + line + ":" + charPositionInLine + " " + msg);
} | @param fieldName
@param gramSize
@return
@throws TooGeneralQueryException | syntaxError | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/code/query/regex/RegexLiterals.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/code/query/regex/RegexLiterals.java | MIT |
@Override
public Collection<String> getUndefinedFields() {
Set<String> undefinedFields = new HashSet<>();
GlobalIssueSetting issueSetting = OneDev.getInstance(SettingManager.class).getIssueSetting();
if (!Issue.QUERY_FIELDS.contains(fieldName)
&& issueSetting.getFieldSpec(fieldName) == null) {
undefinedF... | @return predicate of field value. <tt>null</tt> to indicate that this field is empty | getUndefinedFields | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/entity/issue/FieldCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/entity/issue/FieldCriteria.java | MIT |
@Override
public boolean fixUndefinedFields(Map<String, UndefinedFieldResolution> resolutions) {
for (Map.Entry<String, UndefinedFieldResolution> entry: resolutions.entrySet()) {
if (entry.getValue().getFixType() == UndefinedFieldResolution.FixType.CHANGE_TO_ANOTHER_FIELD) {
if (entry.getKey().equals(fieldNam... | @return predicate of field value. <tt>null</tt> to indicate that this field is empty | fixUndefinedFields | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/entity/issue/FieldCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/entity/issue/FieldCriteria.java | MIT |
public FieldSpec getFieldSpec() {
SettingManager settingManager = OneDev.getInstance(SettingManager.class);
return Preconditions.checkNotNull(settingManager.getIssueSetting().getFieldSpec(fieldName));
} | @return predicate of field value. <tt>null</tt> to indicate that this field is empty | getFieldSpec | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/search/entity/issue/FieldCriteria.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/search/entity/issue/FieldCriteria.java | MIT |
static void encode_base64(byte d[], int len, StringBuilder rs) throws IllegalArgumentException {
int off = 0;
int c1, c2;
if (len <= 0 || len > d.length) {
throw new IllegalArgumentException("Invalid len");
}
while (off < len) {
c1 = d[off++] & 0xff;
... | Encode a byte array using bcrypt's slightly-modified base64 encoding scheme. Note that this
is <strong>not</strong> compatible with the standard MIME-base64 encoding.
@param d the byte array to encode
@param len the number of bytes to encode
@param rs the destination buffer for the base64-encoded string
@exception Ill... | encode_base64 | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
private static byte char64(char x) {
if (x > index_64.length) {
return -1;
}
return index_64[x];
} | Look up the 3 bits base64-encoded by the specified character, range-checking against
conversion table
@param x the base64-encoded value
@return the decoded value of x | char64 | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
static byte[] decode_base64(String s, int maxolen) throws IllegalArgumentException {
ByteArrayOutputStream out = new ByteArrayOutputStream(maxolen);
int off = 0, slen = s.length(), olen = 0;
byte c1, c2, c3, c4, o;
if (maxolen <= 0) {
throw new IllegalArgumentException("Inva... | Decode a string encoded using bcrypt's base64 scheme to a byte array. Note that this is *not*
compatible with the standard MIME-base64 encoding.
@param s the string to decode
@param maxolen the maximum number of bytes to decode
@return an array containing the decoded bytes
@throws IllegalArgumentException if maxolen i... | decode_base64 | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
private final void encipher(int lr[], int off) {
int i, n, l = lr[off], r = lr[off + 1];
l ^= P[0];
for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2;) {
// Feistel substitution on left word
n = S[(l >> 24) & 0xff];
n += S[0x100 | ((l >> 16) & 0xff)];
n ^=... | Blowfish encipher a single 64-bit block encoded as two 32-bit halves
@param lr an array containing the two 32-bit half blocks
@param off the position in the array of the blocks | encipher | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
private static int streamtoword(byte data[], int offp[]) {
int i;
int word = 0;
int off = offp[0];
for (i = 0; i < 4; i++) {
word = (word << 8) | (data[off] & 0xff);
off = (off + 1) % data.length;
}
offp[0] = off;
return word;
} | Cycically extract a word of key material
@param data the string to extract the data from
@param offp a "pointer" (as a one-entry array) to the current offset into data
@return the next word of material from data | streamtoword | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
private void key(byte key[]) {
int i;
int koffp[] = {0};
int lr[] = {0, 0};
int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++) {
P[i] = P[i] ^ streamtoword(key, koffp);
}
for (i = 0; i < plen; i += 2) {
encipher(lr, 0);
... | Key the Blowfish cipher
@param key an array containing the key | key | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) {
int cdata[] = bf_crypt_ciphertext.clone();
int clen = cdata.length;
byte ret[];
long rounds = roundsForLogRounds(log_rounds);
init_key();
ekskey(salt, password);
for (long i = 0; i < rounds... | Perform the central password hashing step in the bcrypt scheme
@param password the password to hash
@param salt the binary salt to hash with the password
@param log_rounds the binary logarithm of the number of rounds of hashing to apply
@return an array containing the binary hashed password | crypt_raw | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
public static String gensalt(int log_rounds, SecureRandom random) {
if (log_rounds < 4 || log_rounds > 31) {
throw new IllegalArgumentException("Bad number of rounds");
}
StringBuilder rs = new StringBuilder();
byte rnd[] = new byte[BCRYPT_SALT_LEN];
random.nextBytes... | Generate a salt for use with the BCrypt.hashpw() method
@param log_rounds the log2 of the number of rounds of hashing to apply - the work factor
therefore increases as 2**log_rounds.
@param random an instance of SecureRandom to use
@return an encoded salt value | gensalt | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
public static String gensalt(int log_rounds) {
return gensalt(log_rounds, new SecureRandom());
} | Generate a salt for use with the BCrypt.hashpw() method
@param log_rounds the log2 of the number of rounds of hashing to apply - the work factor
therefore increases as 2**log_rounds.
@return an encoded salt value | gensalt | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
public static String gensalt() {
return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS);
} | Generate a salt for use with the BCrypt.hashpw() method, selecting a reasonable default for
the number of hashing rounds to apply
@return an encoded salt value | gensalt | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
public static boolean checkpw(String plaintext, String hashed) {
return equalsNoEarlyReturn(hashed, hashpw(plaintext, hashed));
} | Check that a plaintext password matches a previously hashed one
@param plaintext the plaintext password to verify
@param hashed the previously-hashed password
@return true if the passwords match, false otherwise | checkpw | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
static boolean equalsNoEarlyReturn(String a, String b) {
char[] caa = a.toCharArray();
char[] cab = b.toCharArray();
if (caa.length != cab.length) {
return false;
}
byte ret = 0;
for (int i = 0; i < caa.length; i++) {
ret |= caa[i] ^ cab[i];
... | Check that a plaintext password matches a previously hashed one
@param plaintext the plaintext password to verify
@param hashed the previously-hashed password
@return true if the passwords match, false otherwise | equalsNoEarlyReturn | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/BCrypt.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/BCrypt.java | MIT |
public static boolean canOpenTerminal(Build build) {
var subject = getSubject();
var user = getAuthUser(subject);
if (user == null)
return false;
var project = build.getProject();
if (SecurityUtils.canManageProject(subject, project)
|| build.getRequest() != null && build.getRequest().getSubmitter().eq... | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canOpenTerminal | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canEditIssueField(Project project, String fieldName) {
return getSubject().isPermitted(new ProjectPermission(project, new EditIssueField(Sets.newHashSet(fieldName))));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canEditIssueField | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canEditIssueLink(Project project, LinkSpec link) {
return getSubject().isPermitted(new ProjectPermission(project, new EditIssueLink(link)));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canEditIssueLink | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canScheduleIssues(Project project) {
return getSubject().isPermitted(new ProjectPermission(project, new ScheduleIssues()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canScheduleIssues | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean isAssignedRole(Project project, Role role) {
String principal = (String) getSubject().getPrincipal();
var user = getAuthUser(principal);
if (user != null) {
for (UserAuthorization authorization: user.getProjectAuthorizations()) {
Project authorizedProject = authorization.getProject();... | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | isAssignedRole | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
private static boolean isAssignedDefaultRole(Project project, Role role) {
return role.getDefaultProjects().stream().anyMatch(it->it.isSelfOrAncestorOf(project));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | isAssignedDefaultRole | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessProject(Project project) {
return canAccessProject(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessProject | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessConfidentialIssues(Project project) {
return canAccessConfidentialIssues(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessConfidentialIssues | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessConfidentialIssues(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new AccessConfidentialIssues()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessConfidentialIssues | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessTimeTracking(Project project) {
return getSubject().isPermitted(new ProjectPermission(project, new AccessTimeTracking()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessTimeTracking | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessIssue(Issue issue) {
return canAccessIssue(getSubject(), issue);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessIssue | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessProject(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new AccessProject()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessProject | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canAccessIssue(Subject subject, Issue issue) {
Permission permission = new ProjectPermission(issue.getProject(), new ConfidentialIssuePermission(issue));
return issue.isConfidential() && subject.isPermitted(permission)
|| !issue.isConfidential() && canAccessProject(subject, issue.getProjec... | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canAccessIssue | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canCreateChildren(Project project) {
return getSubject().isPermitted(new ProjectPermission(project, new CreateChildren()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canCreateChildren | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canReadCode(Project project) {
return canReadCode(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canReadCode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canReadCode(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new ReadCode()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canReadCode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canWriteCode(Project project) {
return canWriteCode(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canWriteCode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canWriteCode(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new WriteCode()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canWriteCode | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManageProject(Project project) {
return canManageProject(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManageProject | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManageProject(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new ManageProject()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManageProject | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManageIssues(Project project) {
return canManageIssues(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManageIssues | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManageIssues(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new ManageIssues()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManageIssues | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManageBuilds(Project project) {
return getSubject().isPermitted(new ProjectPermission(project, new ManageBuilds()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManageBuilds | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManagePullRequests(Project project) {
return canManagePullRequests(getSubject(), project);
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManagePullRequests | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
public static boolean canManagePullRequests(Subject subject, Project project) {
return subject.isPermitted(new ProjectPermission(project, new ManagePullRequests()));
} | This method checks if current user is able to open terminal of specified build.
Terminal access means that the user can view secrets used in the build as well
as modifying build logic. So as long as the user can modify build spec of the
build, it should be allowed to open terminal
@param build
@return | canManagePullRequests | java | theonedev/onedev | server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.