private boolean hasPermission(View view) { return view.hasPermission(View.CREATE); }
/** * Gets the read-only list of all {@link View}s. */ @Exported public Collection<View> getViews() { List<View> orig = views(); List<View> copy = new ArrayList<View>(orig.size()); for (View v : orig) { if (v.hasPermission(View.READ)) copy.add(v); } Collections.sort(copy, View.SORTER); return copy; }
public boolean superHasPermission(Permission p) { return super.hasPermission(p); }
@Override public boolean hasPermission(final Permission p) { boolean display = true; //tester la liste vide seulement en lecture if (READ.name.equals(p.name)) { final Collection<TopLevelItem> items = this.getItems(); if (items == null || items.isEmpty()) { display = false; } } else { //Pas en lecture => permission standard display = super.hasPermission(p); } return display; } }
/** * Gets the read-only list of all {@link View}s. */ @Exported public Collection<View> getViews() { List<View> orig = views(); List<View> copy = new ArrayList<View>(orig.size()); for (View v : orig) { if (v.hasPermission(View.READ)) copy.add(v); } Collections.sort(copy, View.SORTER); return copy; }
/** * Gets the read-only list of all {@link View}s. */ @Exported @Override public synchronized Collection<View> getViews() { List<View> copy = new ArrayList<View>(); if (this.isTeamManagementEnabled()) { for (View view : views) { if (view.hasPermission(View.READ)) { copy.add(view); } } } else { copy.addAll(views); } Collections.sort(copy, View.SORTER); return copy; }
public synchronized View getView(String name) { for (View v : views) { if (v.getViewName().equals(name)) { //return v; if (isTeamManagementEnabled()) { return v.hasPermission(View.READ) ? v : null; } else { return v; } } } if (name != null && !name.equals(primaryView)) { // Fallback to subview of primary view if it is a ViewGroup View pv = getPrimaryView(); if (pv instanceof ViewGroup) { View view = ((ViewGroup) pv).getView(name); if (isTeamManagementEnabled()) { return view.hasPermission(View.READ) ? view : null; } else { return view; } } } return null; }
@Override public boolean hasPermission(Permission p) { initPython(); if (pexec.isImplemented(36)) { return pexec.execPythonBool("has_permission", p); } else { return super.hasPermission(p); } }
/** * {@inheritDoc} */ @Override public View getView(String name) { hudson.model.View view = Hudson.getInstance().getView(name); if (view != null) { log.fine("Found view by name '" + name + "'. checking permissions"); if (view.hasPermission(Hudson.READ)) { return DozerUtils.getMapper().map(view, View.class, DozerUtils.FULL_MAP_ID); } else { throw new ForbiddenException(); } } throw new NoSuchViewException(name); }
/** * {@inheritDoc} */ @Override public Views getViews() { Views views = new Views(); for (hudson.model.View view : Hudson.getInstance().getViews()) { log.fine("Found view '" + view.getViewName() + "'. checking permissions"); if (view.hasPermission(Hudson.READ)) { views.add(DozerUtils.getMapper().map(view, View.class, DozerUtils.NAMEONLY_MAP_ID)); } } return views; }