You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by "JHoelli (via GitHub)" <gi...@apache.org> on 2025/11/10 08:57:07 UTC
[PR] Role Management for Assets in create Tasks
JHoelli opened a new pull request, #3897:
URL: https://github.com/apache/streampipes/pull/3897
### Purpose
Resolves #3896 . Option to add resources to Assets is now only available for Asset Admins.
### Remarks
Further restricted access to "Persist Events" to the role PipelineAdmin.
PR introduces (a) breaking change(s): no
PR introduces (a) deprecation(s): no
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Role Management for Assets in create Tasks
Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe commented on code in PR #3897:
URL: https://github.com/apache/streampipes/pull/3897#discussion_r2510813688
##########
ui/src/app/dashboard/dialogs/edit-dashboard/edit-dashboard-dialog.component.ts:
##########
@@ -70,6 +81,13 @@ export class EditDashboardDialogComponent implements OnInit {
}
}
+ hasRole(role: UserRole): boolean {
Review Comment:
Since we have this functionality in several locations, can we extract it into a utility method?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Role Management for Assets in create Tasks
Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe merged PR #3897:
URL: https://github.com/apache/streampipes/pull/3897
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Role Management for Assets in create Tasks
Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe commented on code in PR #3897:
URL: https://github.com/apache/streampipes/pull/3897#discussion_r2510844444
##########
ui/cypress/tests/userManagement/testUserRoleAsset.spec.ts:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { UserRole } from '../../../src/app/_enums/user-role.enum';
+import { UserUtils } from '../../support/utils/UserUtils';
+import { ConnectUtils } from '../../support/utils/connect/ConnectUtils';
+import { PipelineUtils } from '../../support/utils/pipeline/PipelineUtils';
+import { PipelineBtns } from '../../support/utils/pipeline/PipelineBtns';
+import { AssetUtils } from '../../support/utils/asset/AssetUtils';
+import { AdapterBuilder } from '../../support/builder/AdapterBuilder';
+import { DataExplorerUtils } from '../../support/utils/dataExplorer/DataExplorerUtils';
+import { DataExplorerBtns } from '../../support/utils/dataExplorer/DataExplorerBtns';
+import { ConnectBtns } from '../../support/utils/connect/ConnectBtns';
+
+describe('Test User Roles for Pipelines', () => {
Review Comment:
Please provide an expressive name for the tests run in this test suite.
##########
ui/cypress/tests/userManagement/testUserRoleAsset.spec.ts:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { UserRole } from '../../../src/app/_enums/user-role.enum';
+import { UserUtils } from '../../support/utils/UserUtils';
+import { ConnectUtils } from '../../support/utils/connect/ConnectUtils';
+import { PipelineUtils } from '../../support/utils/pipeline/PipelineUtils';
+import { PipelineBtns } from '../../support/utils/pipeline/PipelineBtns';
+import { AssetUtils } from '../../support/utils/asset/AssetUtils';
+import { AdapterBuilder } from '../../support/builder/AdapterBuilder';
+import { DataExplorerUtils } from '../../support/utils/dataExplorer/DataExplorerUtils';
+import { DataExplorerBtns } from '../../support/utils/dataExplorer/DataExplorerBtns';
+import { ConnectBtns } from '../../support/utils/connect/ConnectBtns';
+
+describe('Test User Roles for Pipelines', () => {
+ beforeEach('Setup Test', () => {
+ cy.initStreamPipesTest();
+
+ AssetUtils.goToAssets();
+ AssetUtils.addAndSaveAsset('Asset');
+ });
+
+ it('Connect Asset Role Check ', () => {
+ const newUser = UserUtils.createUser(
+ 'user',
+ UserRole.ROLE_PIPELINE_ADMIN,
+ UserRole.ROLE_ASSET_ADMIN,
+ UserRole.ROLE_CONNECT_ADMIN,
+ UserRole.ROLE_DATA_EXPLORER_ADMIN,
+ UserRole.ROLE_DASHBOARD_ADMIN,
+ );
+
+ UserUtils.switchUser(newUser);
+
+ ConnectUtils.goToConnect();
+
+ ConnectUtils.addAdapter(
+ AdapterBuilder.create('Machine_Data_Simulator')
+ .setName('Machine Data Simulator Test 1')
+ .addInput('input', 'wait-time-ms', '1000')
+ .setStartAdapter(false)
+ .build(),
+ );
+ ConnectBtns.assetCheckbox().should('exist');
+
+ UserUtils.changeUserRole(newUser, UserRole.ROLE_ASSET_ADMIN);
Review Comment:
Could you update the method’s signature—perhaps rename it to `toggleUserRole`, or split it into two separate methods like `addUserRole` and `removeUserRole`? At first, I thought the current method added the asset admin role, but it actually toggles it, correct?
##########
ui/src/app/dashboard/dialogs/edit-dashboard/edit-dashboard-dialog.component.ts:
##########
@@ -70,6 +81,13 @@ export class EditDashboardDialogComponent implements OnInit {
}
}
+ hasRole(role: UserRole): boolean {
Review Comment:
Maybe we can include it into the `CurrentUserService`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Role Management for Assets in create Tasks
Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe commented on code in PR #3897:
URL: https://github.com/apache/streampipes/pull/3897#discussion_r2510851449
##########
ui/cypress/tests/userManagement/testUserRoleAsset.spec.ts:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { UserRole } from '../../../src/app/_enums/user-role.enum';
+import { UserUtils } from '../../support/utils/UserUtils';
+import { ConnectUtils } from '../../support/utils/connect/ConnectUtils';
+import { PipelineUtils } from '../../support/utils/pipeline/PipelineUtils';
+import { PipelineBtns } from '../../support/utils/pipeline/PipelineBtns';
+import { AssetUtils } from '../../support/utils/asset/AssetUtils';
+import { AdapterBuilder } from '../../support/builder/AdapterBuilder';
+import { DataExplorerUtils } from '../../support/utils/dataExplorer/DataExplorerUtils';
+import { DataExplorerBtns } from '../../support/utils/dataExplorer/DataExplorerBtns';
+import { ConnectBtns } from '../../support/utils/connect/ConnectBtns';
+
+describe('Test User Roles for Pipelines', () => {
+ beforeEach('Setup Test', () => {
+ cy.initStreamPipesTest();
+
+ AssetUtils.goToAssets();
+ AssetUtils.addAndSaveAsset('Asset');
+ });
+
+ it('Connect Asset Role Check ', () => {
+ const newUser = UserUtils.createUser(
Review Comment:
Can you initialize the user in the before each?
They always have the same roles, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org