Class: ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ApplicationController
show all
- Defined in:
- frontend/app/controllers/application_controller.rb,
public/app/controllers/application_controller.rb
Direct Known Subclasses
AccessionsController, AgentsController, ArchivalObjectsController, ArkNameController, ArkUpdateController, AssessmentAttributesController, AssessmentsController, BatchDeleteController, BatchMergeController, BulkArchivalObjectUpdaterController, BulkImportController, BulkImportTemplatesController, CiteController, ClassificationTermsController, ClassificationsController, CollectionManagementController, CollectionManagementRecordsController, ContainerProfilesController, ContainersController, CustomReportTemplatesController, DateCalculatorController, DigitalObjectComponentsController, DigitalObjectsController, EnumerationsController, EventsController, ExportsController, ExtentCalculatorController, GroupsController, IndexController, JobsController, LocalesController, LocationProfilesController, LocationsController, OaiConfigController, ObjectsController, PdfController, PreferencesController, RdeTemplatesController, RepositoriesController, RequestsController, ResolverController, ResourcesController, SearchController, SessionController, SpaceCalculatorController, SubjectsController, SystemInfoController, TestsController, TopContainersController, UpdateMonitorController, UsersController, UtilsController, WelcomeController
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.can_access?(context, method) ⇒ Boolean
43
44
45
46
47
48
49
50
51
|
# File 'frontend/app/controllers/application_controller.rb', line 43
def self.can_access?(context, method)
permission_mappings.each do |permission, actions|
if actions.include?(method) && !session_can?(context, permission)
return false
end
end
return true
end
|
.permission_mappings ⇒ Object
39
40
41
|
# File 'frontend/app/controllers/application_controller.rb', line 39
def self.permission_mappings
Array(@permission_mappings)
end
|
.set_access_control(permission_mappings) ⇒ Object
54
55
56
57
58
59
60
61
62
63
64
|
# File 'frontend/app/controllers/application_controller.rb', line 54
def self.set_access_control(permission_mappings)
@permission_mappings = permission_mappings
skip_before_action :unauthorised_access, :only => Array(permission_mappings.values).flatten.uniq
permission_mappings.each do |permission, actions|
next if permission === :public
before_action(:only => Array(actions)) {|c| user_must_have(permission)}
end
end
|
Instance Method Details
#archivesspace ⇒ Object
41
42
43
|
# File 'public/app/controllers/application_controller.rb', line 41
def archivesspace
ArchivesSpaceClient.instance
end
|