-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
user project permissions site admin and project-level permissions project publishing and deletion protect api endpoints views reflect user permission level for site and project add sendgrid config relative auth url stop mailer if no admin users yet typo fix fix project update bug remove auth check from add_images endpoint update projects on sign-in or -out, update mailer from address fix text editor syntax bug
- Loading branch information
Showing
64 changed files
with
2,272 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
class UserProjectPermissionsController < ApplicationController | ||
before_action :set_user_project_permission, only: [:show, :update, :destroy] | ||
before_action only: [:create] do | ||
@project = Project.find(params[:project_id]) | ||
end | ||
before_action only: [:show, :create, :update, :destroy] do | ||
validate_user_admin(@project) | ||
end | ||
|
||
# GET /user_project_permissions/1 | ||
def show | ||
render json: @user_project_permission | ||
end | ||
|
||
# POST /user_project_permissions | ||
def create | ||
@user_project_permission = UserProjectPermission.new(user_project_permission_params) | ||
|
||
if @user_project_permission.save | ||
render json: @user_project_permission, status: :created, location: @user_project_permission | ||
else | ||
render json: @user_project_permission.errors, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
# PATCH/PUT /user_project_permissions/1 | ||
def update | ||
if @user_project_permission.update(user_project_permission_params) | ||
render json: @user_project_permission | ||
else | ||
render json: @user_project_permission.errors, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
# DELETE /user_project_permissions/1 | ||
def destroy | ||
@user_project_permission.destroy | ||
end | ||
|
||
private | ||
# Use callbacks to share common setup or constraints between actions. | ||
def set_user_project_permission | ||
@user_project_permission = UserProjectPermission.find(params[:id]) | ||
@project = @user_project_permission.project | ||
end | ||
|
||
# Only allow a trusted parameter "white list" through. | ||
def user_project_permission_params | ||
params.require(:user_project_permission).permit(:project_id, :user_id, :permission) | ||
end | ||
end |
Oops, something went wrong.