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

Harden permission management #1651

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

Conversation

SamuelWei
Copy link
Collaborator

@SamuelWei SamuelWei commented Nov 29, 2024

Type (Highlight the corresponding type)

  • Bugfix
  • Feature
  • Documentation
  • Refactoring (e.g. Style updates, Test implementation, etc.)
  • Other (please describe):

Checklist

  • Code updated to current develop branch head
  • Passes CI checks
  • Is a part of an issue
  • Tests added for the bugfix or newly implemented feature, describe below why if not
  • Changelog is updated
  • Documentation of code and features exists

Changes

  • Prevent non-superusers from deleting or editing superusers
  • Prevent non-superusers from assigning the superuser role to other users
  • Environment variable for configuring restricted permissions that cannot be assigned to non-superuser roles
  • Display raw permission names in the admin interface
  • Real-time input validation on create superuser command

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 74.35897% with 20 lines in your changes missing coverage. Please review.

Project coverage is 81.07%. Comparing base (b030a62) to head (6b34c08).

Files with missing lines Patch % Lines
resources/js/views/AdminRolesView.vue 0.00% 13 Missing ⚠️
resources/js/policies/UserPolicy.js 0.00% 4 Missing ⚠️
app/Models/Role.php 93.33% 1 Missing ⚠️
resources/js/components/UserTabSection.vue 75.00% 1 Missing ⚠️
resources/js/views/AdminUsersNew.vue 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1651      +/-   ##
=============================================
+ Coverage      81.01%   81.07%   +0.05%     
- Complexity      1340     1351      +11     
=============================================
  Files            361      361              
  Lines           9225     9269      +44     
  Branches         853      860       +7     
=============================================
+ Hits            7474     7515      +41     
- Misses          1751     1754       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cypress bot commented Nov 29, 2024

PILOS    Run #1509

Run Properties:  status check passed Passed #1509  •  git commit 6b34c08e84: Harden permission management
Project PILOS
Branch Review harden-permission-management
Run status status check passed Passed #1509
Run duration 04m 51s
Commit git commit 6b34c08e84: Harden permission management
Committer Samuel Weirich
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 237
View all changes introduced in this branch ↗︎

@SamuelWei
Copy link
Collaborator Author

image

@SamuelWei SamuelWei force-pushed the harden-permission-management branch from 67a9a90 to 927abf6 Compare December 16, 2024 13:58
@SamuelWei SamuelWei marked this pull request as ready for review December 16, 2024 16:44
@SamuelWei SamuelWei force-pushed the harden-permission-management branch from ad4338e to 0278095 Compare December 17, 2024 15:13
@SamuelWei SamuelWei added this to the v4.3 milestone Dec 17, 2024
@SamuelWei SamuelWei force-pushed the harden-permission-management branch from 5370fae to 6b34c08 Compare December 19, 2024 10:17
@SamuelWei SamuelWei modified the milestones: v4.3, v4.2 Dec 19, 2024
Copy link
Collaborator

@danielmachill danielmachill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many more codecov warnings than usual. not sure if this is an issue here


## Permissions

Permissions are the smallest unit of access control in PILOS. They define what actions a user can perform in the system, except in rooms, where a user's role also influences their abilities.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions allowed to perform are not abilities? not 100% sure what this is supposed to mean

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ideas is: Permissions usually decide what a user can / cannot do. Inside a room there is an additional permission system in place where the role of a user in the room influences what the user can / cannot do.
Do you have suggestions how this could be communicated in a more clear way?

@SamuelWei
Copy link
Collaborator Author

many more codecov warnings than usual. not sure if this is an issue here

If you look at the details of the report, you can see that most sections are 100% covered and the sections with no changes / decreases are not covered yet by frontend tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants