Class: DbdocAdmin::BaseController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/dbdoc_engine/dbdoc_admin/base_controller.rb

Instance Method Summary collapse

Instance Method Details

#can_delete? ⇒ Boolean

Checks if the current user has permission to delete resources. Only users with the 'superadmin' role are allowed.

Returns:

  • (Boolean)


16
17
18
# File 'app/controllers/dbdoc_engine/dbdoc_admin/base_controller.rb', line 16

def can_delete?
  current_user.superadmin?
end

#can_edit? ⇒ Boolean

Checks if the current user has permission to edit resources. Typically allows access for users with the 'admin' role or higher.

Returns:

  • (Boolean)


10
11
12
# File 'app/controllers/dbdoc_engine/dbdoc_admin/base_controller.rb', line 10

def can_edit?
  current_user.admin_or_higher?
end