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

E2484. Reimplement participants_controller.rb #7

Closed
wants to merge 7 commits into from

Conversation

SahithiAmmana
Copy link

Add action_allowed and rename a few methods - merge into expertiza#135

Kashika08 and others added 6 commits December 11, 2024 17:24
Removed Assignment as foreign key from questionnaire.

Co-authored-by: kmalick <[email protected]>
* Add github workflows and fixing rspec model cases.

Removed Assignment as foreign key from questionnaire.

* Fixing spelling issues

* Fixing spelling issues

---------

Co-authored-by: kmalick <[email protected]>
* Implemented authorization logic via Application controller

* Integration with courses controller requiring at least Instructor level authorization

* Made return values more consistent for definite role determination

* Tests for authorization concern

* Consistent parameter names

* Added tests for all_actions_allowed? method under auth concern

* Added tests for action_allowed? method under auth concern

* Added tests for authorize method under auth concern

* Correction in role for all_actions_allowed

* Fixes in auth spec description and courses tests

* Editing names of methods to make it more readable

---------

Co-authored-by: anshganatra <[email protected]>
Co-authored-by: kmalick <[email protected]>
* Implemented authorization logic via Application controller

* Integration with courses controller requiring at least Instructor level authorization

* Made return values more consistent for definite role determination

* Tests for authorization concern

* Consistent parameter names

* Added tests for all_actions_allowed? method under auth concern

* Added tests for action_allowed? method under auth concern

* Added tests for authorize method under auth concern

* Correction in role for all_actions_allowed

* Fixes in auth spec description and courses tests

* Editing names of methods to make it more readable

---------

Co-authored-by: anshganatra <[email protected]>
Co-authored-by: kmalick <[email protected]>
@@ -1,10 +1,15 @@
class Api::V1::ParticipantsController < ApplicationController
include ParticipantsHelper

# Returns true if the user has TA privileges; otherwise, denies access by returning false.
def action_allowed?
current_user_has_ta_privileges?

Choose a reason for hiding this comment

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

This is not how we check action allowed now.
has_required_role?('Teaching Assistant') is how it should be done.

Copy link
Author

Choose a reason for hiding this comment

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

Done! @Kashika08

@SahithiAmmana SahithiAmmana deleted the patch-1 branch January 29, 2025 20:17
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.

3 participants