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 String[] getOrganizationModelResources() {
145 return getResourceActions().getOrganizationModelResources();
146 }
147
148 public static String[] getPortalModelResources() {
149 return getResourceActions().getPortalModelResources();
150 }
151
152 public static String getPortletBaseResource(String portletName) {
153 return getResourceActions().getPortletBaseResource(portletName);
154 }
155
156 public static List<String> getPortletModelResources(String portletName) {
157 return getResourceActions().getPortletModelResources(portletName);
158 }
159
160 public static List<String> getPortletNames() {
161 return getResourceActions().getPortletNames();
162 }
163
164 public static List<String> getPortletResourceActions(Portlet portlet) {
165 return getResourceActions().getPortletResourceActions(portlet);
166 }
167
168 public static List<String> getPortletResourceActions(String name) {
169 return getResourceActions().getPortletResourceActions(name);
170 }
171
172 public static List<String> getPortletResourceGroupDefaultActions(
173 String name) {
174
175 return getResourceActions().getPortletResourceGroupDefaultActions(name);
176 }
177
178 public static List<String> getPortletResourceGuestDefaultActions(
179 String name) {
180
181 return getResourceActions().getPortletResourceGuestDefaultActions(name);
182 }
183
184 public static List<String> getPortletResourceGuestUnsupportedActions(
185 String name) {
186
187 return getResourceActions().getPortletResourceGuestUnsupportedActions(
188 name);
189 }
190
191 public static List<String> getPortletResourceLayoutManagerActions(
192 String name) {
193
194 return getResourceActions().getPortletResourceLayoutManagerActions(
195 name);
196 }
197
198 public static ResourceActions getResourceActions() {
199 PortalRuntimePermission.checkGetBeanProperty(ResourceActionsUtil.class);
200
201 return _resourceActions;
202 }
203
204 public static List<String> getResourceActions(String name) {
205 return getResourceActions().getResourceActions(name);
206 }
207
208 public static List<String> getResourceActions(
209 String portletResource, String modelResource) {
210
211 return getResourceActions().getResourceActions(
212 portletResource, modelResource);
213 }
214
215 public static List<String> getResourceGroupDefaultActions(String name) {
216 return getResourceActions().getResourceGroupDefaultActions(name);
217 }
218
219 public static List<String> getResourceGuestUnsupportedActions(
220 String portletResource, String modelResource) {
221
222 return getResourceActions().getResourceGuestUnsupportedActions(
223 portletResource, modelResource);
224 }
225
226
230 public static List<Role> getRoles(
231 long companyId, Group group, String modelResource)
232 throws SystemException {
233
234 return getResourceActions().getRoles(companyId, group, modelResource);
235 }
236
237 public static List<Role> getRoles(
238 long companyId, Group group, String modelResource, int[] roleTypes)
239 throws SystemException {
240
241 return getResourceActions().getRoles(
242 companyId, group, modelResource, roleTypes);
243 }
244
245 public static boolean hasModelResourceActions(String name) {
246 return getResourceActions().hasModelResourceActions(name);
247 }
248
249
252 public static void init() {
253 }
254
255 public static boolean isOrganizationModelResource(String modelResource) {
256 return getResourceActions().isOrganizationModelResource(modelResource);
257 }
258
259 public static boolean isPortalModelResource(String modelResource) {
260 return getResourceActions().isPortalModelResource(modelResource);
261 }
262
263 public static void read(
264 String servletContextName, ClassLoader classLoader, String source)
265 throws Exception {
266
267 getResourceActions().read(servletContextName, classLoader, source);
268 }
269
270 public static void read(String servletContextName, InputStream inputStream)
271 throws Exception {
272
273 getResourceActions().read(servletContextName, inputStream);
274 }
275
276 public void setResourceActions(ResourceActions resourceActions) {
277 PortalRuntimePermission.checkSetBeanProperty(getClass());
278
279 _resourceActions = resourceActions;
280 }
281
282 private static ResourceActions _resourceActions;
283
284 }