chore: apply suggestions

Signed-off-by: Frank Kong <frkong@redhat.com>
This commit is contained in:
Frank Kong
2024-05-02 22:36:30 -04:00
parent e5b903599f
commit ea7cb44de5
10 changed files with 36 additions and 55 deletions
+2 -16
View File
@@ -30,13 +30,6 @@ export const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';
*/
export const RESOURCE_TYPE_SCAFFOLDER_ACTION = 'scaffolder-action';
/**
* Permission resource type which corresponds to a scaffolder task.
*
* @alpha
*/
export const RESOURCE_TYPE_SCAFFOLDER_TASK = 'scaffolder-task';
/**
* This permission is used to authorize actions that involve executing
* an action from a template.
@@ -49,6 +42,7 @@ export const actionExecutePermission = createPermission({
resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,
});
// TODO: Figure out whether to convert this to a basic permission or remove it completely since the current rules aren't applicable to this permission
/**
* This permission is used to authorize actions that involve access the action registry
*
@@ -101,8 +95,6 @@ export const templateStepReadPermission = createPermission({
* This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,
* and reading logs of tasks
*
* Task cancellation would also require this permission.
*
* @alpha
*/
export const taskReadPermission = createPermission({
@@ -110,7 +102,6 @@ export const taskReadPermission = createPermission({
attributes: {
action: 'read',
},
resourceType: RESOURCE_TYPE_SCAFFOLDER_TASK,
});
/**
@@ -123,20 +114,16 @@ export const taskCreatePermission = createPermission({
attributes: {
action: 'create',
},
resourceType: RESOURCE_TYPE_SCAFFOLDER_TASK,
});
/**
* This permission us used to authorize actions that involve the cancellation of tasks in the scaffolder.
*
* This will require the `scaffolder.task.read` permission to be authorized.
* This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.
*
* @alpha
*/
export const taskCancelPermission = createPermission({
name: 'scaffolder.task.cancel',
attributes: {},
resourceType: RESOURCE_TYPE_SCAFFOLDER_TASK,
});
/**
@@ -144,7 +131,6 @@ export const taskCancelPermission = createPermission({
* @alpha
*/
export const scaffolderPermissions = [
actionExecutePermission,
templateParameterReadPermission,
templateStepReadPermission,
];