-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Permission.java
137 lines (115 loc) · 3.78 KB
/
Permission.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* Copyright 2010-2013 Ning, Inc.
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.killbill.billing.security;
public enum Permission {
/*
* Account
*/
ACCOUNT_CAN_CREATE("account", "create"),
ACCOUNT_CAN_UPDATE("account", "update"),
ACCOUNT_CAN_ADD_EMAILS("account", "add_emails"),
ACCOUNT_CAN_DELETE_EMAILS("account", "delete_emails"),
ACCOUNT_CAN_CHARGE("account", "charge"),
ACCOUNT_CAN_CREDIT("account", "credit"),
/*
* Catalog
*/
CATALOG_CAN_UPLOAD("catalog", "config_upload"),
CATALOG_CAN_DELETE("catalog", "delete"),
/**
* Custom fields
*/
CUSTOM_FIELDS_CAN_ADD("custom_field", "add"),
CUSTOM_FIELDS_CAN_UPDATE("custom_field", "update"),
CUSTOM_FIELDS_CAN_DELETE("custom_field", "delete"),
/*
* Entitlement
*/
ENTITLEMENT_CAN_CREATE("entitlement", "create"),
ENTITLEMENT_CAN_CHANGE_PLAN("entitlement", "change_plan"),
ENTITLEMENT_CAN_PAUSE_RESUME("entitlement", "pause_resume"),
ENTITLEMENT_CAN_CANCEL("entitlement", "cancel"),
ENTITLEMENT_CAN_TRANSFER("entitlement", "transfer"),
/*
* Invoice
*/
INVOICE_CAN_CREDIT("invoice", "credit"),
INVOICE_CAN_ITEM_ADJUST("invoice", "item_adjust"),
INVOICE_CAN_DELETE_CBA("invoice", "delete_cba"),
INVOICE_CAN_TRIGGER_INVOICE("invoice", "trigger"),
INVOICE_CAN_DRY_RUN_INVOICE("invoice", "dry_run"),
INVOICE_CAN_WRITE_OFF("invoice", "write_off"),
INVOICE_CAN_COMMIT("invoice", "commit"),
INVOICE_CAN_VOID("invoice", "void"),
/*
* Overdue
*/
OVERDUE_CAN_UPLOAD("overdue", "config_upload"),
/*
* Payment
*/
PAYMENT_CAN_TRIGGER_PAYMENT("payment", "trigger"),
PAYMENT_CAN_REFUND("payment", "refund"),
PAYMENT_CAN_CHARGEBACK("payment", "chargeback"),
PAYMENT_CAN_TRANSITION("payment", "transition"),
PAYMENT_CAN_PROCESS_NOTIFICATION("payment", "notification"),
/**
* Payment methods
*/
PAYMENT_METHOD_CAN_CREATE("payment_method", "create"),
PAYMENT_METHOD_CAN_UPDATE("payment_method", "update"),
PAYMENT_METHOD_CAN_DELETE("payment_method", "delete"),
/*
* Tag
*/
TAG_CAN_CREATE_TAG_DEFINITION("tag", "create_tag_definition"),
TAG_CAN_DELETE_TAG_DEFINITION("tag", "delete_tag_definition"),
TAG_CAN_ADD("tag", "add"),
TAG_CAN_DELETE("tag", "delete"),
TENANT_CAN_CREATE("tenant", "create"),
/**
* Tenant keys
*/
TENANT_KEYS_CAN_ADD("tenant_kvs", "add"),
TENANT_KEYS_CAN_DELETE("tenant_kvs", "delete"),
/**
* Usage
*/
USAGE_CAN_RECORD("usage", "record"),
USER_CAN_CREATE("user", "create"),
/*
* Administrator that can update state (to correct data associated to bugs, ...)
*/
ADMIN_CAN_FIX_DATA("admin", "update"),
ADMIN_CAN_EXPORT("admin", "export"),
ADMIN_CAN_TRIGGER_COMMAND("admin", "trigger_command");
private final String group;
private final String value;
Permission(final String group, final String value) {
this.group = group;
this.value = value;
}
public String getGroup() {
return group;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.format("%s:%s", group, value);
}
}