Fixing commit conflicts

revert-70aa11f8
prabathabey 9 years ago
commit 88cab5abf5

@ -29,6 +29,7 @@ import org.wso2.carbon.apimgt.webapp.publisher.APIConfig;
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService;
import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherUtil; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherUtil;
import org.wso2.carbon.apimgt.webapp.publisher.config.APIResourceConfiguration; import org.wso2.carbon.apimgt.webapp.publisher.config.APIResourceConfiguration;
import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig;
import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder; import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import org.wso2.carbon.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor; import org.wso2.carbon.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor;
@ -48,7 +49,8 @@ public class APIPublisherLifecycleListener implements LifecycleListener {
@Override @Override
public void lifecycleEvent(LifecycleEvent lifecycleEvent) { public void lifecycleEvent(LifecycleEvent lifecycleEvent) {
if (Lifecycle.AFTER_START_EVENT.equals(lifecycleEvent.getType())) { if (Lifecycle.AFTER_START_EVENT.equals(lifecycleEvent.getType()) && WebappPublisherConfig.getInstance()
.isPublished()) {
StandardContext context = (StandardContext) lifecycleEvent.getLifecycle(); StandardContext context = (StandardContext) lifecycleEvent.getLifecycle();
ServletContext servletContext = context.getServletContext(); ServletContext servletContext = context.getServletContext();
String param = servletContext.getInitParameter(PARAM_MANAGED_API_ENABLED); String param = servletContext.getInitParameter(PARAM_MANAGED_API_ENABLED);

@ -44,7 +44,7 @@ public interface ActivityInfoProviderService {
@ApiOperation( @ApiOperation(
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "GET",
response = Activity.class, response = Activity.class,
value = "Retrieve details of a particular activity.", value = "Retrieve details of a particular activity.",
notes = "This will return information of a particular activity i.e. meta information of an operation, " + notes = "This will return information of a particular activity i.e. meta information of an operation, " +
@ -78,7 +78,7 @@ public interface ActivityInfoProviderService {
code = 500, code = 500,
message = "Internal Server Error. \n Server error occurred while fetching activity data.") message = "Internal Server Error. \n Server error occurred while fetching activity data.")
}) })
@Permission(scope = "operation-view", permissions = {"/permission/admin/device-mgt/admin/devices/view"}) @Permission(scope = "activity-view", permissions = {"/permission/admin/device-mgt/admin/activities/view"})
Response getActivity( Response getActivity(
@ApiParam( @ApiParam(
name = "id", name = "id",

@ -82,7 +82,7 @@ public class DeviceMgtAPIUtils {
} }
public static DeviceManagementProviderService getDeviceManagementService() { public static DeviceManagementProviderService getDeviceManagementService() {
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
DeviceManagementProviderService deviceManagementProviderService = DeviceManagementProviderService deviceManagementProviderService =
(DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null); (DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
if (deviceManagementProviderService == null) { if (deviceManagementProviderService == null) {
@ -94,7 +94,7 @@ public class DeviceMgtAPIUtils {
} }
public static GroupManagementProviderService getGroupManagementProviderService() { public static GroupManagementProviderService getGroupManagementProviderService() {
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
GroupManagementProviderService groupManagementProviderService = GroupManagementProviderService groupManagementProviderService =
(GroupManagementProviderService) ctx.getOSGiService(GroupManagementProviderService.class, null); (GroupManagementProviderService) ctx.getOSGiService(GroupManagementProviderService.class, null);
if (groupManagementProviderService == null) { if (groupManagementProviderService == null) {
@ -108,7 +108,7 @@ public class DeviceMgtAPIUtils {
public static UserStoreManager getUserStoreManager() throws UserStoreException { public static UserStoreManager getUserStoreManager() throws UserStoreException {
RealmService realmService; RealmService realmService;
UserStoreManager userStoreManager; UserStoreManager userStoreManager;
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
realmService = (RealmService) ctx.getOSGiService(RealmService.class, null); realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
if (realmService == null) { if (realmService == null) {
String msg = "Realm service has not initialized."; String msg = "Realm service has not initialized.";
@ -126,7 +126,7 @@ public class DeviceMgtAPIUtils {
public static UserRealm getUserRealm() throws UserStoreException { public static UserRealm getUserRealm() throws UserStoreException {
RealmService realmService; RealmService realmService;
UserRealm realm; UserRealm realm;
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
realmService = (RealmService) ctx.getOSGiService(RealmService.class, null); realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
if (realmService == null) { if (realmService == null) {
@ -140,7 +140,7 @@ public class DeviceMgtAPIUtils {
public static AuthorizationManager getAuthorizationManager() throws UserStoreException { public static AuthorizationManager getAuthorizationManager() throws UserStoreException {
RealmService realmService; RealmService realmService;
AuthorizationManager authorizationManager; AuthorizationManager authorizationManager;
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
realmService = (RealmService) ctx.getOSGiService(RealmService.class, null); realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
if (realmService == null) { if (realmService == null) {
throw new IllegalStateException("Realm service is not initialized."); throw new IllegalStateException("Realm service is not initialized.");
@ -159,7 +159,7 @@ public class DeviceMgtAPIUtils {
} }
public static ApplicationManagementProviderService getAppManagementService() { public static ApplicationManagementProviderService getAppManagementService() {
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
ApplicationManagementProviderService applicationManagementProviderService = ApplicationManagementProviderService applicationManagementProviderService =
(ApplicationManagementProviderService) ctx.getOSGiService(ApplicationManagementProviderService.class, null); (ApplicationManagementProviderService) ctx.getOSGiService(ApplicationManagementProviderService.class, null);
if (applicationManagementProviderService == null) { if (applicationManagementProviderService == null) {
@ -170,7 +170,7 @@ public class DeviceMgtAPIUtils {
public static PolicyManagerService getPolicyManagementService() { public static PolicyManagerService getPolicyManagementService() {
PolicyManagerService policyManagementService; PolicyManagerService policyManagementService;
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
policyManagementService = policyManagementService =
(PolicyManagerService) ctx.getOSGiService(PolicyManagerService.class, null); (PolicyManagerService) ctx.getOSGiService(PolicyManagerService.class, null);
if (policyManagementService == null) { if (policyManagementService == null) {
@ -194,7 +194,7 @@ public class DeviceMgtAPIUtils {
public static NotificationManagementService getNotificationManagementService() { public static NotificationManagementService getNotificationManagementService() {
NotificationManagementService notificationManagementService; NotificationManagementService notificationManagementService;
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
notificationManagementService = (NotificationManagementService) ctx.getOSGiService( notificationManagementService = (NotificationManagementService) ctx.getOSGiService(
NotificationManagementService.class, null); NotificationManagementService.class, null);
if (notificationManagementService == null) { if (notificationManagementService == null) {
@ -204,7 +204,7 @@ public class DeviceMgtAPIUtils {
} }
public static CertificateManagementService getCertificateManagementService() { public static CertificateManagementService getCertificateManagementService() {
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
CertificateManagementService certificateManagementService = (CertificateManagementService) CertificateManagementService certificateManagementService = (CertificateManagementService)
ctx.getOSGiService(CertificateManagementService.class, null); ctx.getOSGiService(CertificateManagementService.class, null);
@ -227,7 +227,7 @@ public class DeviceMgtAPIUtils {
} }
public static DeviceInformationManager getDeviceInformationManagerService() { public static DeviceInformationManager getDeviceInformationManagerService() {
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
DeviceInformationManager deviceInformationManager = DeviceInformationManager deviceInformationManager =
(DeviceInformationManager) ctx.getOSGiService(DeviceInformationManager.class, null); (DeviceInformationManager) ctx.getOSGiService(DeviceInformationManager.class, null);
if (deviceInformationManager == null) { if (deviceInformationManager == null) {
@ -238,7 +238,7 @@ public class DeviceMgtAPIUtils {
public static SearchManagerService getSearchManagerService() { public static SearchManagerService getSearchManagerService() {
CarbonContext ctx = CarbonContext.getThreadLocalCarbonContext(); PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
SearchManagerService searchManagerService = SearchManagerService searchManagerService =
(SearchManagerService) ctx.getOSGiService(SearchManagerService.class, null); (SearchManagerService) ctx.getOSGiService(SearchManagerService.class, null);
if (searchManagerService == null) { if (searchManagerService == null) {

@ -29,7 +29,98 @@
--> -->
<PermissionConfiguration> <PermissionConfiguration>
<APIVersion></APIVersion> <APIVersion></APIVersion>
<!-- Activity related APIs -->
<Permission>
<name>Fetch Activity related details</name>
<path>/device-mgt/admin/activities/view</path>
<url>/activities/*</url>
<method>GET</method>
</Permission>
<!-- Activity related APIs -->
<!-- Device related APIs --> <!-- Device related APIs -->
<Permission>
<name>List devices</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add policy</name>
<path>/device-mgt/admin/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add User policy</name>
<path>/device-mgt/user/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit policy</name>
<path>/device-mgt/admin/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit User policy</name>
<path>/device-mgt/user/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/admin/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>View user device</name>
<path>/device-mgt/user/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>Modify user device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/type/*/id/*</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Remove user device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/type/*/id/*</url>
<method>DELETE</method>
</Permission>
<Permission> <Permission>
<name>Device Management</name> <name>Device Management</name>
@ -143,82 +234,7 @@
<method>GET</method> <method>GET</method>
</Permission> </Permission>
<Permission>
<name>List devices</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/admin/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>List device types</name>
<path>/device-mgt/user/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add policy</name>
<path>/device-mgt/admin/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add User policy</name>
<path>/device-mgt/user/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit policy</name>
<path>/device-mgt/admin/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit User policy</name>
<path>/device-mgt/user/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/admin/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>View user device</name>
<path>/device-mgt/user/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
</Permission>
<Permission>
<name>Modify user device</name>
<path>/device-mgt/user/devices/update</path>
<url>/devices/type/*/id/*</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Remove user device</name>
<path>/device-mgt/user/devices/remove</path>
<url>/devices/type/*/id/*</url>
<method>DELETE</method>
</Permission>
<!--<Permission>--> <!--<Permission>-->
<!--<name>Get device</name>--> <!--<name>Get device</name>-->

Loading…
Cancel
Save