summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/activities/action.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/activities/action.go b/models/activities/action.go
index 432bf8bf3f..07c8053425 100644
--- a/models/activities/action.go
+++ b/models/activities/action.go
@@ -126,6 +126,15 @@ func (at ActionType) String() string {
}
}
+func (at ActionType) InActions(actions ...string) bool {
+ for _, action := range actions {
+ if action == at.String() {
+ return true
+ }
+ }
+ return false
+}
+
// Action represents user operation type and other information to
// repository. It implemented interface base.Actioner so that can be
// used in template render.