-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Creating a rake task to onboard new customers * Creating a rake task to onboard new customers * owner and organization admin can manage their organization * Update gems * Event Policy * Rolling back to appmap 0.99.1 as 0.99.3 creates routing issues * EventPolicy * Better Policy around User Management * Better presentation of the roles * Organiztion and User policies * Adding a SettingsPolicy * Better welcome screen * Copy TXT record and some explanations for non tech users * Adding Manage Polls to navbar * Code optimization and query optimization * Better poll display * Gem updates --------- Co-authored-by: Stephane Paquet <spaquet@up4b.com>
- Loading branch information
Showing
28 changed files
with
347 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
class SettingsController < ApplicationController | ||
before_action :authenticate_user! | ||
before_action :redirect_if_unauthenticated | ||
before_action :set_organization_and_authorize | ||
|
||
layout "settings" | ||
|
||
# GET /settings/ | ||
def index | ||
# TODO add a condition for when a user is an admin for the account. so that extraction of the organization will be something like current_user.member.organization | ||
# TODO add a second condition owner: true | ||
# Current code only displays account information when the user is the owner | ||
organization = Member.find_by(user_id: current_user.id, owner: true).organization | ||
if organization | ||
@organization_id = organization.id | ||
@user_count = organization.members.count | ||
@organization_owner = true | ||
if @organization | ||
@organization_id = @organization.id | ||
@user_count = @organization.members.count | ||
@organization_owner = current_user.member.owner? | ||
else | ||
flash[:alert] = "You are not the owner of this organization" | ||
redirect_to root_path | ||
end | ||
end | ||
|
||
private | ||
|
||
def set_organization_and_authorize | ||
@organization = current_user.organization | ||
authorize @organization, :index?, policy_class: SettingsPolicy | ||
end | ||
end |
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
Oops, something went wrong.