/** * Convenience method for obtaining Brix instance. This is the preferred way to obtain the instance. * * @return brix instance */ public Brix getBrix() { return Brix.get(); }
public Workspace getObject() { if (workspace == null && workspaceId != null) { workspace = Brix.get().getWorkspaceManager().getWorkspace(workspaceId); } return workspace; } }
@Override public boolean isVisible() { final Action action = new AccessMenuPluginAction(getWorkspaceModel().getObject()); return Brix.get().getAuthorizationStrategy().isActionAuthorized(action); } }
@Override public boolean isVisible() { final Action action = new AccessSitePluginAction(getWorkspaceModel().getObject()); final boolean granted = Brix.get().getAuthorizationStrategy().isActionAuthorized(action); if (granted) { JcrSession session = Brix.get().getCurrentSession(getWorkspaceModel().getObject().getId()); SitePlugin sp = SitePlugin.get(); return sp.canEditNode(sp.getGlobalContainer(session), Context.ADMINISTRATION); } return false; } }
@Override protected RulesNode load() { JcrSession session = Brix.get().getCurrentSession(workspaceModel.getObject().getId()); return SitePlugin.get().getWebDavRules(session); } }
private static String getDefaultWorkspaceName() { Brix brix = Brix.get(); final Workspace workspace = brix.getConfig().getMapper().getWorkspaceForRequest(RequestCycle.get(), brix); return (workspace != null) ? workspace.getId() : null; }
protected void checkAccess() { BrixNode node = getModelObject(); if (!SitePlugin.get().canViewNode(node, Context.PRESENTATION)) { throw Brix.get().getForbiddenException(); } }
@Override public boolean isVisible() { final Action action = new AccessSitePluginAction(getWorkspaceModel().getObject()); return Brix.get().getAuthorizationStrategy().isActionAuthorized(action); } }
@Override public boolean isVisible() { final Action action = new AccessSitePluginAction(getWorkspaceModel().getObject()); final boolean granted = Brix.get().getAuthorizationStrategy().isActionAuthorized(action); if (granted) { JcrSession session = Brix.get().getCurrentSession(getWorkspaceModel().getObject().getId()); SitePlugin sp = SitePlugin.get(); return sp.canEditNode(sp.getGlobalContainer(session), Context.ADMINISTRATION); } return false; } }
private static BrixNode getContainerNode(Workspace workspace) { JcrSession session = Brix.get().getCurrentSession(workspace.getId()); return SitePlugin.get().getGlobalContainer(session); }
private Brix getBrix() { // TODO: We don't really have a node here return Brix.get(); } }
@Override public boolean isVisible() { final Brix brix = Brix.get(); final Workspace workspace = getWorkspaceModel().getObject(); final Action action = new AccessWebDavUrlPluginAction(workspace); final boolean granted = brix.getAuthorizationStrategy().isActionAuthorized(action); return granted; } }
private static BrixNode getRootNode(IModel<Workspace> workspaceModel) { Workspace workspace = workspaceModel.getObject(); if (workspace != null) { BrixNode root = (BrixNode) Brix.get().getCurrentSession(workspace.getId()).getItem( SitePlugin.get().getSiteRootPath()); return root; } else { return null; } }
private Brix getBrix() { return Brix.get(); }
@Override public boolean isVisible() { final Action action = new AccessPrototypePluginAction(getWorkspaceModel().getObject()); return Brix.get().getAuthorizationStrategy().isActionAuthorized(action); }
public NodePickerTreeModel(String workspaceName) { JcrSession session = Brix.get().getCurrentSession(workspaceName); root = new NodePickerTreeNode((BrixNode) session.getItem(SitePlugin.get().getSiteRootPath())); }
private Brix getBrix() { return Brix.get(); }
@Override public boolean isVisible() { final Action action = new AccessSnapshotPluginAction(getWorkspaceModel().getObject()); return Brix.get().getAuthorizationStrategy().isActionAuthorized(action); }
public static Brix get() { Application application = Application.get(); if (application == null) { throw new IllegalStateException( "Could not find Application threadlocal; this method can only be called within a Wicket request"); } return get(application); }
@Override public boolean isVisible() { Workspace workspace = PublishingPanel.this.getModelObject(); String state = SitePlugin.get().getWorkspaceState(workspace); Action action = new PublishWorkspaceAction(Context.ADMINISTRATION, workspace, targetState); return requiredState.equals(state) && Brix.get().getAuthorizationStrategy().isActionAuthorized( action); } }