Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/WP-682: Fix Community Project Folders on Core portals #1041

Merged
merged 12 commits into from
Feb 3, 2025
Prev Previous commit
Next Next commit
Resolving issues with root directory hardcoding and refactoring funct…
…ion to use the system terminology instead of project terminology
  • Loading branch information
fnets committed Jan 15, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4fa22cd5b6a0538f461691a13035c7d27a87e8cc
Original file line number Diff line number Diff line change
@@ -60,8 +60,8 @@ def set_workspace_acls(client, system_id, path, username, operation, role):
}

if settings.PORTAL_PROJECTS_USE_SET_FACL_JOB:
logger.info(f"Using setfacl job to submit ACL change for project: {path}, username: {username}, operation: {operation}, role: {role}")
job_res = submit_workspace_acls_job(username, path, role, operation)
logger.info(f"Using setfacl job to submit ACL change for project: {system_id}, username: {username}, operation: {operation}, role: {role}")
job_res = submit_workspace_acls_job(username, system_id, role, operation)
logger.info(f"Submitted workspace ACL job {job_res.name} with UUID {job_res.uuid}")
return

@@ -83,8 +83,10 @@ def submit_workspace_acls_job(
client = service_account()
portal_name = settings.PORTAL_NAMESPACE

prj = client.systems.getSystem(systemId=system_id)

job_body = {
"name": f"setfacl-project-{project_name}-{username}-{action}-{role}",
"name": f"setfacl-project-{system_id}-{username}-{action}-{role}",
"appId": "setfacl-corral-wmaprtl",
"appVersion": "0.0.1",
"description": "Add/Remove ACLs on a directory",
@@ -96,7 +98,7 @@ def submit_workspace_acls_job(
{"key": "usernames", "value": username},
{
"key": "directory",
"value": f"{settings.PORTAL_PROJECTS_ROOT_DIR}/{project_name}",
"value": f"{prj.rootDir}",
},
{"key": "action", "value": action},
{"key": "role", "value": role},