openaustralia/planningalerts

View on GitHub
sorbet/rbi/gems/rolify@6.0.1.rbi

Summary

Maintainability
Test Coverage
# typed: true

# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rolify` gem.
# Please instead update this file by running `bin/tapioca gem rolify`.


# source://rolify//lib/rolify/adapters/base.rb#1
module Rolify
  extend ::Rolify::Configure

  # Returns the value of attribute adapter.
  #
  # source://rolify//lib/rolify.rb#38
  def adapter; end

  # Sets the attribute adapter
  #
  # @param value the value to set the attribute adapter to.
  #
  # source://rolify//lib/rolify.rb#11
  def adapter=(_arg0); end

  # Returns the value of attribute resource_adapter.
  #
  # source://rolify//lib/rolify.rb#57
  def resource_adapter; end

  # Sets the attribute resource_adapter
  #
  # @param value the value to set the attribute resource_adapter to.
  #
  # source://rolify//lib/rolify.rb#11
  def resource_adapter=(_arg0); end

  # source://rolify//lib/rolify.rb#43
  def resourcify(association_name = T.unsafe(nil), options = T.unsafe(nil)); end

  # source://rolify//lib/rolify.rb#67
  def role_class; end

  # Returns the value of attribute role_cname.
  #
  # source://rolify//lib/rolify.rb#11
  def role_cname; end

  # Sets the attribute role_cname
  #
  # @param value the value to set the attribute role_cname to.
  #
  # source://rolify//lib/rolify.rb#11
  def role_cname=(_arg0); end

  # Returns the value of attribute role_join_table_name.
  #
  # source://rolify//lib/rolify.rb#11
  def role_join_table_name; end

  # Sets the attribute role_join_table_name
  #
  # @param value the value to set the attribute role_join_table_name to.
  #
  # source://rolify//lib/rolify.rb#11
  def role_join_table_name=(_arg0); end

  # Returns the value of attribute role_table_name.
  #
  # source://rolify//lib/rolify.rb#11
  def role_table_name; end

  # Sets the attribute role_table_name
  #
  # @param value the value to set the attribute role_table_name to.
  #
  # source://rolify//lib/rolify.rb#11
  def role_table_name=(_arg0); end

  # source://rolify//lib/rolify.rb#14
  def rolify(options = T.unsafe(nil)); end

  # source://rolify//lib/rolify.rb#62
  def scopify; end

  # Returns the value of attribute strict_rolify.
  #
  # source://rolify//lib/rolify.rb#11
  def strict_rolify; end

  # Sets the attribute strict_rolify
  #
  # @param value the value to set the attribute strict_rolify to.
  #
  # source://rolify//lib/rolify.rb#11
  def strict_rolify=(_arg0); end

  private

  # source://rolify//lib/rolify/finders.rb#37
  def parse_args(args, users, &block); end

  class << self
    # source://rolify//lib/rolify.rb#72
    def resource_types; end
  end
end

# source://rolify//lib/rolify/adapters/base.rb#2
module Rolify::Adapter; end

# source://rolify//lib/rolify/adapters/base.rb#3
class Rolify::Adapter::Base
  # @return [Base] a new instance of Base
  #
  # source://rolify//lib/rolify/adapters/base.rb#4
  def initialize(role_cname, user_cname); end

  # source://rolify//lib/rolify/adapters/base.rb#27
  def relation_types_for(relation); end

  # source://rolify//lib/rolify/adapters/base.rb#9
  def role_class; end

  # source://rolify//lib/rolify/adapters/base.rb#17
  def role_table; end

  # source://rolify//lib/rolify/adapters/base.rb#13
  def user_class; end

  class << self
    # source://rolify//lib/rolify/adapters/base.rb#21
    def create(adapter, role_cname, user_cname); end
  end
end

# source://rolify//lib/rolify/adapters/base.rb#54
class Rolify::Adapter::ResourceAdapterBase < ::Rolify::Adapter::Base
  # @raise [NotImplementedError]
  #
  # source://rolify//lib/rolify/adapters/base.rb#59
  def in(resources, roles); end

  # @raise [NotImplementedError]
  #
  # source://rolify//lib/rolify/adapters/base.rb#55
  def resources_find(roles_table, relation, role_name); end
end

# source://rolify//lib/rolify/adapters/base.rb#32
class Rolify::Adapter::RoleAdapterBase < ::Rolify::Adapter::Base
  # @raise [NotImplementedError]
  #
  # source://rolify//lib/rolify/adapters/base.rb#41
  def add(relation, role_name, resource = T.unsafe(nil)); end

  # @raise [NotImplementedError]
  # @return [Boolean]
  #
  # source://rolify//lib/rolify/adapters/base.rb#49
  def exists?(relation, column); end

  # @raise [NotImplementedError]
  #
  # source://rolify//lib/rolify/adapters/base.rb#37
  def find_or_create_by(role_name, resource_type = T.unsafe(nil), resource_id = T.unsafe(nil)); end

  # @raise [NotImplementedError]
  #
  # source://rolify//lib/rolify/adapters/base.rb#45
  def remove(relation, role_name, resource = T.unsafe(nil)); end

  # @raise [NotImplementedError]
  #
  # source://rolify//lib/rolify/adapters/base.rb#33
  def where(relation, args); end
end

# source://rolify//lib/rolify/configure.rb#2
module Rolify::Configure
  # @yield [_self]
  # @yieldparam _self [Rolify::Configure] the object that the method was called on
  #
  # source://rolify//lib/rolify/configure.rb#7
  def configure(*role_cnames); end

  # source://rolify//lib/rolify/configure.rb#12
  def dynamic_shortcuts; end

  # source://rolify//lib/rolify/configure.rb#16
  def dynamic_shortcuts=(is_dynamic); end

  # source://rolify//lib/rolify/configure.rb#20
  def orm; end

  # source://rolify//lib/rolify/configure.rb#24
  def orm=(orm); end

  # source://rolify//lib/rolify/configure.rb#48
  def remove_role_if_empty; end

  # source://rolify//lib/rolify/configure.rb#44
  def remove_role_if_empty=(is_remove); end

  # source://rolify//lib/rolify/configure.rb#37
  def use_defaults; end

  # source://rolify//lib/rolify/configure.rb#32
  def use_dynamic_shortcuts; end

  # source://rolify//lib/rolify/configure.rb#28
  def use_mongoid; end

  private

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/configure.rb#67
  def role_table_missing?(role_class); end

  # source://rolify//lib/rolify/configure.rb#54
  def sanity_check(role_cnames); end
end

# source://rolify//lib/rolify/dynamic.rb#4
module Rolify::Dynamic
  # source://rolify//lib/rolify/dynamic.rb#5
  def define_dynamic_method(role_name, resource); end
end

# source://rolify//lib/rolify/finders.rb#2
module Rolify::Finders
  # source://rolify//lib/rolify/finders.rb#16
  def with_all_roles(*args); end

  # source://rolify//lib/rolify/finders.rb#26
  def with_any_role(*args); end

  # source://rolify//lib/rolify/finders.rb#3
  def with_role(role_name, resource = T.unsafe(nil)); end

  # source://rolify//lib/rolify/finders.rb#12
  def without_role(role_name, resource = T.unsafe(nil)); end
end

# source://rolify//lib/rolify/railtie.rb#5
class Rolify::Railtie < ::Rails::Railtie; end

# source://rolify//lib/rolify/resource.rb#2
module Rolify::Resource
  mixes_in_class_methods ::Rolify::Resource::ClassMethods

  # source://rolify//lib/rolify/resource.rb#44
  def applied_roles; end

  class << self
    # @private
    #
    # source://rolify//lib/rolify/resource.rb#3
    def included(base); end
  end
end

# source://rolify//lib/rolify/resource.rb#7
module Rolify::Resource::ClassMethods
  # source://rolify//lib/rolify/resource.rb#36
  def applied_roles(children = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#27
  def except_as(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#27
  def except_multiple_as(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#12
  def find_as(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#12
  def find_multiple_as(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#8
  def find_roles(role_name = T.unsafe(nil), user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#12
  def with_role(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#12
  def with_roles(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#27
  def without_role(role_name, user = T.unsafe(nil)); end

  # source://rolify//lib/rolify/resource.rb#27
  def without_roles(role_name, user = T.unsafe(nil)); end
end

# source://rolify//lib/rolify/role.rb#5
module Rolify::Role
  extend ::Rolify::Utils

  mixes_in_class_methods ::Rolify::Finders

  # source://rolify//lib/rolify/role.rb#12
  def add_role(role_name, resource = T.unsafe(nil)); end

  # source://rolify//lib/rolify/role.rb#12
  def grant(role_name, resource = T.unsafe(nil)); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#56
  def has_all_roles?(*args); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#69
  def has_any_role?(*args); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#47
  def has_cached_role?(role_name, resource = T.unsafe(nil)); end

  # source://rolify//lib/rolify/utils.rb#4
  def has_no_role(*args); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#25
  def has_role?(role_name, resource = T.unsafe(nil)); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#52
  def has_strict_cached_role?(role_name, resource = T.unsafe(nil)); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#43
  def has_strict_role?(role_name, resource); end

  # source://rolify//lib/rolify/role.rb#92
  def method_missing(method, *args, &block); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#77
  def only_has_role?(role_name, resource = T.unsafe(nil)); end

  # source://rolify//lib/rolify/role.rb#81
  def remove_role(role_name, resource = T.unsafe(nil)); end

  # @return [Boolean]
  #
  # source://rolify//lib/rolify/role.rb#101
  def respond_to?(method, include_private = T.unsafe(nil)); end

  # source://rolify//lib/rolify/role.rb#81
  def revoke(role_name, resource = T.unsafe(nil)); end

  # source://rolify//lib/rolify/role.rb#88
  def roles_name; end

  class << self
    # @private
    #
    # source://rolify//lib/rolify/role.rb#8
    def included(base); end
  end
end

# source://rolify//lib/rolify/utils.rb#2
module Rolify::Utils
  # source://rolify//lib/rolify/utils.rb#3
  def deprecate(old_method, new_method); end
end