Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cocoakekeyu/cancan
/ functions
Functions
60 in github.com/cocoakekeyu/cancan
⨍
Functions
60
◇
Types & classes
12
↓ 44 callers
Method
can
Check if the user has permission to perform a given action on an object
cancan/ability.py:46
↓ 24 callers
Method
add
Add ability are allowed using two arguments. The first one is the action you're setting the permission for, the second one i
cancan/ability.py:21
↓ 5 callers
Function
authorize
(user, action, subject)
django_example/blog/auth.py:29
↓ 2 callers
Method
add_rule
(self, rule)
cancan/ability.py:43
↓ 2 callers
Method
addnot
Defines an ability which cannot be done.
cancan/ability.py:37
↓ 2 callers
Method
alias_action
Alias one or more actions into another one. self.alias_action('create', 'read', 'update', 'delete', to='crud')
cancan/ability.py:92
↓ 2 callers
Function
listify
(o)
cancan/rule.py:12
↓ 1 callers
Method
cannot
Convenience method which works the same as "can" but returns the opposite value.
cancan/ability.py:55
↓ 1 callers
Function
create
(request)
django_example/blog/views.py:35
↓ 1 callers
Function
delete
(request, article_id)
django_example/blog/views.py:58
↓ 1 callers
Method
expand_actions
Accepts an array of actions and returns an array of actions which match
cancan/ability.py:81
↓ 1 callers
Function
index
(request)
django_example/blog/views.py:28
↓ 1 callers
Method
init_guest_ability
(self)
django_example/blog/auth.py:17
↓ 1 callers
Method
init_superuser_ability
(self)
django_example/blog/auth.py:25
↓ 1 callers
Method
init_user_ability
(self)
django_example/blog/auth.py:20
↓ 1 callers
Method
is_relevant
Matches both the subject and action, not necessarily the conditions.
cancan/rule.py:42
↓ 1 callers
Method
matches_action
(self, action)
cancan/rule.py:52
↓ 1 callers
Method
matches_conditions
(self, action, subject, **conditions)
cancan/rule.py:70
↓ 1 callers
Method
matches_dict_conditions
(self, action, subject)
cancan/rule.py:80
↓ 1 callers
Method
matches_function
(self, action, subject)
cancan/rule.py:84
↓ 1 callers
Method
matches_subject
(self, subject)
cancan/rule.py:48
↓ 1 callers
Method
matches_subject_class
(self, subject)
cancan/rule.py:56
↓ 1 callers
Method
optimize
(self, rules)
cancan/ability.py:72
↓ 1 callers
Method
relevant_rules_for_match
retrive match action and subject
cancan/ability.py:62
↓ 1 callers
Function
show
(request, article_id)
django_example/blog/views.py:42
↓ 1 callers
Function
update
(request, article_id)
django_example/blog/views.py:50
Method
__init__
(self, id, name, role)
example.py:5
Method
__init__
(self, title, user_id)
example.py:12
Method
__init__
(self, user)
example.py:22
Method
__init__
(self, user)
django_example/blog/auth.py:7
Method
__init__
(self, title, user_id)
cancan/tests.py:57
Method
__init__
The first argument when initializing is the base_behavior which is a true/false value. True for "can" and false for "cannot".
cancan/rule.py:20
Method
__str__
(self)
cancan/rule.py:39
Method
aliased_actions
(self)
cancan/ability.py:111
Function
dispatch
(request, *args, **kwargs)
django_example/blog/views.py:8
Method
expanded_actions
(self)
cancan/rule.py:90
Method
has_all
(rule)
cancan/ability.py:73
Function
item_dispatch
(request, *args, **kwargs)
django_example/blog/views.py:17
Method
rules
(self)
cancan/ability.py:119
Method
setUp
(self)
django_example/blog/tests.py:9
Method
setUp
(self)
cancan/tests.py:9
Method
test
(subject, id, len_title)
cancan/tests.py:92
Method
test_admin_can_delete_all
(self)
django_example/blog/tests.py:64
Method
test_admin_can_update_all
(self)
django_example/blog/tests.py:52
Method
test_alias_action
(self)
cancan/tests.py:48
Method
test_base_ability
(self)
cancan/tests.py:12
Method
test_conditions
(self)
cancan/tests.py:55
Method
test_fuction
(self)
cancan/tests.py:69
Method
test_fuction_with_args
(self)
cancan/tests.py:86
Method
test_guest_can_not_create
(self)
django_example/blog/tests.py:35
Method
test_guest_index
(self)
django_example/blog/tests.py:23
Method
test_list_action_or_subject
(self)
cancan/tests.py:30
Method
test_not_action
(self)
cancan/tests.py:41
Function
test_title_gt_100
(article)
example.py:17
Method
test_user_can_not_delete
(self)
django_example/blog/tests.py:58
Method
test_user_can_not_update
(self)
django_example/blog/tests.py:46
Method
test_user_create
(self)
django_example/blog/tests.py:29
Method
test_user_index
(self)
django_example/blog/tests.py:17
Method
test_user_update_owner_article
(self)
django_example/blog/tests.py:40
Method
user_id_less_10
(subject)
cancan/tests.py:75