001
014
015 package com.liferay.portal.security.permission;
016
017 import com.liferay.portal.NoSuchResourceActionException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
020 import com.liferay.portal.model.Group;
021 import com.liferay.portal.model.Portlet;
022 import com.liferay.portal.model.Role;
023
024 import java.io.InputStream;
025
026 import java.util.List;
027 import java.util.Locale;
028
029 import javax.servlet.jsp.PageContext;
030
031
035 public class ResourceActionsUtil {
036
037
040 public static final String ACTION_NAME_PREFIX =
041 ResourceActions.ACTION_NAME_PREFIX;
042
043
046 public static final String MODEL_RESOURCE_NAME_PREFIX =
047 ResourceActions.MODEL_RESOURCE_NAME_PREFIX;
048
049
053 public static final String[] ORGANIZATION_MODEL_RESOURCES =
054 ResourceActions.ORGANIZATION_MODEL_RESOURCES;
055
056
059 public static final String[] PORTAL_MODEL_RESOURCES =
060 ResourceActions.PORTAL_MODEL_RESOURCES;
061
062 public static void checkAction(String name, String actionId)
063 throws NoSuchResourceActionException {
064
065 getResourceActions().checkAction(name, actionId);
066 }
067
068 public static String getAction(Locale locale, String action) {
069 return getResourceActions().getAction(locale, action);
070 }
071
072 public static String getAction(PageContext pageContext, String action) {
073 return getResourceActions().getAction(pageContext, action);
074 }
075
076 public static String getActionNamePrefix() {
077 return getResourceActions().getActionNamePrefix();
078 }
079
080 public static List<String> getActionsNames(
081 PageContext pageContext, List<String> actions) {
082
083 return getResourceActions().getActionsNames(pageContext, actions);
084 }
085
086 public static List<String> getActionsNames(
087 PageContext pageContext, String name, long actionIds) {
088
089 return getResourceActions().getActionsNames(
090 pageContext, name, actionIds);
091 }
092
093 public static List<String> getModelNames() {
094 return getResourceActions().getModelNames();
095 }
096
097 public static List<String> getModelPortletResources(String name) {
098 return getResourceActions().getModelPortletResources(name);
099 }
100
101 public static String getModelResource(Locale locale, String name) {
102 return getResourceActions().getModelResource(locale, name);
103 }
104
105 public static String getModelResource(
106 PageContext pageContext, String name) {
107
108 return getResourceActions().getModelResource(pageContext, name);
109 }
110
111 public static List<String> getModelResourceActions(String name) {
112 return getResourceActions().getModelResourceActions(name);
113 }
114
115 public static List<String> getModelResourceGroupDefaultActions(
116 String name) {
117
118 return getResourceActions().getModelResourceGroupDefaultActions(name);
119 }
120
121 public static List<String> getModelResourceGuestDefaultActions(
122 String name) {
123
124 return getResourceActions().getModelResourceGuestDefaultActions(name);
125 }
126
127 public static List<String> getModelResourceGuestUnsupportedActions(
128 String name) {
129
130 return getResourceActions().getModelResourceGuestUnsupportedActions(
131 name);
132 }
133
134 public static String getModelResourceNamePrefix() {
135 return getResourceActions().getModelResourceNamePrefix();
136 }
137
138 public static List<String> getModelResourceOwnerDefaultActions(
139 String name) {
140
141 return getResourceActions().getModelResourceOwnerDefaultActions(name);
142 }
143
144 public static Double getModelResourceWeight(String name) {
145 return getResourceActions().getModelResourceWeight(name);
146 }
147
148 public static String[] getOrganizationModelResources() {
149 return getResourceActions().getOrganizationModelResources();
150 }
151
152 public static String[] getPortalModelResources() {
153 return getResourceActions().getPortalModelResources();
154 }
155
156 public static String getPortletBaseResource(String portletName) {
157 return getResourceActions().getPortletBaseResource(portletName);
158 }
159
160 public static List<String> getPortletModelResources(String portletName) {
161 return getResourceActions().getPortletModelResources(portletName);
162 }
163
164 public static List<String> getPortletNames() {
165 return getResourceActions().getPortletNames();
166 }
167
168 public static List<String> getPortletResourceActions(Portlet portlet) {
169 return getResourceActions().getPortletResourceActions(portlet);
170 }
171
172 public static List<String> getPortletResourceActions(String name) {
173 return getResourceActions().getPortletResourceActions(name);
174 }
175
176 public static List<String> getPortletResourceGroupDefaultActions(
177 String name) {
178
179 return getResourceActions().getPortletResourceGroupDefaultActions(name);
180 }
181
182 public static List<String> getPortletResourceGuestDefaultActions(
183 String name) {
184
185 return getResourceActions().getPortletResourceGuestDefaultActions(name);
186 }
187
188 public static List<String> getPortletResourceGuestUnsupportedActions(
189 String name) {
190
191 return getResourceActions().getPortletResourceGuestUnsupportedActions(
192 name);
193 }
194
195 public static List<String> getPortletResourceLayoutManagerActions(
196 String name) {
197
198 return getResourceActions().getPortletResourceLayoutManagerActions(
199 name);
200 }
201
202 public static ResourceActions getResourceActions() {
203 PortalRuntimePermission.checkGetBeanProperty(ResourceActionsUtil.class);
204
205 return _resourceActions;
206 }
207
208 public static List<String> getResourceActions(String name) {
209 return getResourceActions().getResourceActions(name);
210 }
211
212 public static List<String> getResourceActions(
213 String portletResource, String modelResource) {
214
215 return getResourceActions().getResourceActions(
216 portletResource, modelResource);
217 }
218
219 public static List<String> getResourceGroupDefaultActions(String name) {
220 return getResourceActions().getResourceGroupDefaultActions(name);
221 }
222
223 public static List<String> getResourceGuestUnsupportedActions(
224 String portletResource, String modelResource) {
225
226 return getResourceActions().getResourceGuestUnsupportedActions(
227 portletResource, modelResource);
228 }
229
230
234 public static List<Role> getRoles(
235 long companyId, Group group, String modelResource)
236 throws SystemException {
237
238 return getResourceActions().getRoles(companyId, group, modelResource);
239 }
240
241 public static List<Role> getRoles(
242 long companyId, Group group, String modelResource, int[] roleTypes)
243 throws SystemException {
244
245 return getResourceActions().getRoles(
246 companyId, group, modelResource, roleTypes);
247 }
248
249 public static boolean hasModelResourceActions(String name) {
250 return getResourceActions().hasModelResourceActions(name);
251 }
252
253
256 public static void init() {
257 }
258
259 public static boolean isOrganizationModelResource(String modelResource) {
260 return getResourceActions().isOrganizationModelResource(modelResource);
261 }
262
263 public static boolean isPortalModelResource(String modelResource) {
264 return getResourceActions().isPortalModelResource(modelResource);
265 }
266
267 public static void read(
268 String servletContextName, ClassLoader classLoader, String source)
269 throws Exception {
270
271 getResourceActions().read(servletContextName, classLoader, source);
272 }
273
274 public static void read(String servletContextName, InputStream inputStream)
275 throws Exception {
276
277 getResourceActions().read(servletContextName, inputStream);
278 }
279
280 public void setResourceActions(ResourceActions resourceActions) {
281 PortalRuntimePermission.checkSetBeanProperty(getClass());
282
283 _resourceActions = resourceActions;
284 }
285
286 private static ResourceActions _resourceActions;
287
288 }