-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with string/atom mix in changeset
- Loading branch information
1 parent
062f109
commit f21f512
Showing
19 changed files
with
355 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
defmodule Sanbase.Metric.Registry.Permissions do | ||
def can?(:create, _) do | ||
# Will depend on the user roles as well | ||
deployment_env() == "stage" or (deployment_env() == "dev" and not aws_db_url?()) | ||
end | ||
|
||
def can?(:edit, _) do | ||
# Will depend on the user roles as well | ||
deployment_env() == "stage" or (deployment_env() == "dev" and not aws_db_url?()) | ||
end | ||
|
||
def can?(:start_sync, _) do | ||
# Will depend on the user roles as well | ||
deployment_env() == "stage" or (deployment_env() == "dev" and not aws_db_url?()) | ||
end | ||
|
||
def can?(:apply_change_suggestions, _) do | ||
# Will depend on the user roles | ||
true | ||
end | ||
|
||
defp deployment_env() do | ||
Sanbase.Utils.Config.module_get(Sanbase, :deployment_env) | ||
end | ||
|
||
defp aws_db_url?() do | ||
db_url = System.get_env("DATABASE_URL") | ||
is_binary(db_url) and db_url =~ "aws" | ||
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
File renamed without changes.
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.