Skip to content

Commit

Permalink
feat: new schedule execution permission [BACKLOG-40066] (#5560)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrasil authored Mar 20, 2024
1 parent b27effe commit 0e3803b
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,13 @@
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerExecuteAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
<pen:attr key="priority" value="35"/>
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
Expand Down
8 changes: 8 additions & 0 deletions extensions/src/it/resources/repository.spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,13 @@
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerExecuteAction" id="SchedulerExecuteAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
<pen:attr key="priority" value="35"/>
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerAction" id="SchedulerAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
Expand Down Expand Up @@ -588,6 +595,7 @@
<util:list id="AuthorizationActions">
<ref bean="RepositoryReadAction"/>
<ref bean="RepositoryCreateAction"/>
<ref bean="SchedulerExecuteAction"/>
<ref bean="SchedulerAction"/>
<ref bean="AdministerSecurityAction"/>
<ref bean="PublishAction"/>
Expand Down
8 changes: 8 additions & 0 deletions extensions/src/test/resources/repository.spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,13 @@
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerExecuteAction" id="SchedulerExecuteAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
<pen:attr key="priority" value="35"/>
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerAction" id="SchedulerAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
Expand Down Expand Up @@ -588,6 +595,7 @@
<util:list id="AuthorizationActions">
<ref bean="RepositoryReadAction"/>
<ref bean="RepositoryCreateAction"/>
<ref bean="SchedulerExecuteAction"/>
<ref bean="SchedulerAction"/>
<ref bean="AdministerSecurityAction"/>
<ref bean="PublishAction"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,11 @@
<pen:attr key="priority" value="45"/>
</pen:attributes>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerExecuteAction">
<pen:attributes>
<pen:attr key="priority" value="35"/>
</pen:attributes>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerAction">
<pen:attributes>
<pen:attr key="priority" value="40"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*!
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License, version 2 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/gpl-2.0.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*
* Copyright (c) 2024 Hitachi Vantara. All rights reserved.
*
*/

package org.pentaho.platform.security.policy.rolebased.actions;

import java.util.ResourceBundle;

public class SchedulerExecuteAction extends AbstractAuthorizationAction {
public static final String NAME = "org.pentaho.scheduler.execute";
ResourceBundle resourceBundle;

@Override
public String getName() {
return NAME;
}

@Override
public String getLocalizedDisplayName( String localeString ) {
resourceBundle = getResourceBundle( localeString );
return resourceBundle.getString( NAME );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ org.pentaho.security.administerSecurity=Administer Security
org.pentaho.security.administerSystem=Manage System
org.pentaho.security.publish=Publish Content
org.pentaho.scheduler.manage=Schedule Content
org.pentaho.scheduler.execute=Execute Schedules
RepositoryTenantManager.publicFolderDisplayName=Public
RepositoryTenantManager.usersFolderDisplayName=Home
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ org.pentaho.security.administerSecurity=Manage Tenant
org.pentaho.security.administerSystem=Manage System
org.pentaho.security.publish=Publish Content
org.pentaho.scheduler.manage=Schedule Content
org.pentaho.scheduler.execute=Execute Schedules

AbstractJcrBackedUserRoleDao.ERROR_0001_LAST_ADMIN_ROLE=Removing last admin user from role {0} is not allowed.
AbstractJcrBackedUserRoleDao.ERROR_0002_ROLE_NOT_FOUND=Role not found.
Expand Down
8 changes: 8 additions & 0 deletions repository/src/main/resources/repository.spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,13 @@
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerExecuteAction" id="SchedulerExecuteAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
<pen:attr key="priority" value="35"/>
</pen:attributes>
</pen:publish>
</bean>
<bean class="org.pentaho.platform.security.policy.rolebased.actions.SchedulerAction" id="SchedulerAction">
<pen:publish as-type="INTERFACES">
<pen:attributes>
Expand Down Expand Up @@ -590,6 +597,7 @@
<util:list id="AuthorizationActions">
<ref bean="RepositoryReadAction"/>
<ref bean="RepositoryCreateAction"/>
<ref bean="SchedulerExecuteAction"/>
<ref bean="SchedulerAction"/>
<ref bean="AdministerSecurityAction"/>
<ref bean="PublishAction"/>
Expand Down

0 comments on commit 0e3803b

Please sign in to comment.