This file contains hidden or 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
| class Web::Realty::SearchesController < Web::Realty::ApplicationController | |
| before_filter do | |
| add_breadcrumb t('realty.menu.finder'), realty_search_path | |
| end | |
| def show | |
| total_facets | |
| static_info | |
| end |
This file contains hidden or 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
| class Web::Account::FacebookController < Web::Account::ApplicationController | |
| def create_link | |
| fb_hash = FacebookIntegration.get_auth_hash( | |
| create_link_account_facebook_url, params['code']) | |
| FacebookService.create_link(current_user, fb_hash) | |
| redirect_to account_root_url, | |
| :notice => t('web.messages.account.facebook.linked') | |
| rescue UserBlockedError | |
| redirect_to account_root_url, |
This file contains hidden or 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
| class Web::User::FacebookController < Web::User::ApplicationController | |
| def register | |
| fb_hash = FacebookIntegration.get_auth_hash( | |
| register_user_facebook_url, params['code']) | |
| user = FacebookService.register(fb_hash) | |
| sign_in(user) | |
| redirect_to :root, :notice => t('web.messages.user.facebook.logged_in') | |
| rescue UserBlockedError | |
| redirect_to :root, :error => t('web.messages.users.blocked') | |
| rescue ConfirmationRequiredError => error |
This file contains hidden or 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
| env :production do | |
| key 'value' | |
| foo 'bar' | |
| sections do | |
| first 'first_value' | |
| second 'second_value' | |
| end | |
| end | |
| env :development, :parent => :production do |
This file contains hidden or 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
| require "errors" | |
| class FacebookService | |
| class << self | |
| def register(data_hash) | |
| data = AuthData.new(data_hash) | |
| auth = User::Facebook.find_by_uid(data.uid) | |
| if auth | |
| raise UserBlockedError if auth.user.blocked? |
This file contains hidden or 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
| require "errors" | |
| class GoogleService | |
| private_class_method :new | |
| class << self | |
| def register(data_hash) | |
| data = AuthData.new(data_hash) | |
| auth = User::Google.find_by_uid(data.uid) |
This file contains hidden or 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
| class FacebookService | |
| class << self | |
| def register_via_google(data) | |
| auth = User::Google.find_by_uid(data.uid) | |
| if auth | |
| return :block if auth.user.blocked? | |
| auth.user.activate! unless auth.user.active? | |
| return :success | |
| end |
This file contains hidden or 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
| module AccessHelper | |
| include AuthHelper | |
| def check_access(values = {}) | |
| acl.check! self.class.to_s, self.action_name, current_roles, values | |
| end | |
| def current_roles | |
| @current_roles ||= current_user.roles_hash.keys | |
| end |
This file contains hidden or 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
| YaAcl::Builder.build do | |
| roles do | |
| role :admin, :name => 'Администратор' | |
| role :remote_operator, :name => 'Удаленный Оператор' | |
| role :editor, :name => 'Редактор' | |
| role :taxonom, :name => 'Таксоном' | |
| role :operator, :name => 'Оператор' | |
| role :solo_operator, :name => 'Соло Оператор' | |
| role :transcripter, :name => 'Транскриптер' | |
| role :transcripts_editor, :name => 'Редактор транскриптов' |
This file contains hidden or 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
| module ConfirmationHelper | |
| extend ActiveSupport::Concern | |
| include AuthHelper | |
| included do | |
| alias_method_chain :sign_out, :confirmation_request_clear | |
| end | |
| module InstanceMethods |