Merge pull request #3 from GPrathap/release-2.0.x

renamed permission string
revert-70aa11f8
Milan Perera 8 years ago committed by GitHub
commit 32bbb072fb

@ -41,7 +41,7 @@ import javax.ws.rs.core.Response;
name = "Sign CSR", name = "Sign CSR",
description = "Sign CSR", description = "Sign CSR",
key = "cdmf:sign-csr", key = "cdmf:sign-csr",
permissions = {"/certificate-mgt/sign-csr"} permissions = {"/device-mgt/certificates/manage"}
) )
} }
) )

@ -64,12 +64,18 @@ import javax.ws.rs.core.Response;
" operation details and responses from devices.") " operation details and responses from devices.")
@Scopes( @Scopes(
scopes = { scopes = {
@Scope( @Scope(
name = "Getting Details of an Activity", name = "Getting Details of an Activity",
description = "Getting Details of an Activity", description = "Getting Details of an Activity",
key = "cdmf:activities:details", key = "cdmf:activities:id",
permissions = {"/device-mgt/devices/owning-device/view"} permissions = {"/device-mgt/devices/owning-device/view"}
) ),
@Scope(
name = "Getting Activity Details",
description = "Getting Activity Details",
key = "cdmf:activities:details",
permissions = {"/device-mgt/devices/owning-device/view"}
)
} }
) )
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@ -87,7 +93,7 @@ public interface ActivityInfoProviderService {
tags = "Activity Info Provider", tags = "Activity Info Provider",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "cdmf:activities:details") @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:activities:id")
}) })
} }
) )

@ -13,10 +13,13 @@ import io.swagger.annotations.Info;
import io.swagger.annotations.ResponseHeader; import io.swagger.annotations.ResponseHeader;
import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag; import io.swagger.annotations.Tag;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.mgt.analytics.dashboard.bean.DeviceCountByGroup; import org.wso2.carbon.device.mgt.analytics.dashboard.bean.DeviceCountByGroup;
import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardGadgetDataWrapper; import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardGadgetDataWrapper;
import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardPaginationGadgetDataWrapper; import org.wso2.carbon.device.mgt.jaxrs.beans.DashboardPaginationGadgetDataWrapper;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
import javax.ws.rs.GET; import javax.ws.rs.GET;
@ -44,6 +47,70 @@ import javax.ws.rs.core.Response;
@Tag(name = "device_management", description = "Device Analytics Dashboard related APIs.") @Tag(name = "device_management", description = "Device Analytics Dashboard related APIs.")
} }
) )
@Scopes(
scopes = {
@Scope(
name = "Device Count Overview",
description = "Device Count Overview",
key = "cdmf:dashboard:count-overview",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Device Counts by Potential Vulnerabilities",
description = "Device Counts by Potential Vulnerabilities",
key = "cdmf:dashboard:vulnerabilities",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get the number of devices that have not complied to a policy",
description = "Get the number of devices that have not complied to a policy",
key = "cdmf:dashboard:non-compliant",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get the number of devices for a given device type, such as connectivity status, "
+ "potential vulnerability, platform, and ownership",
description = "Get the number of devices for a given device type, such as connectivity status, "
+ "potential vulnerability, platform, and ownership",
key = "cdmf:dashboard:by-groups",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get the number of devices that have not complied to a given policy based on a particular",
description = "Get the number of devices that have not complied to a given policy based on a particular",
key = "cdmf:dashboard:device-counts",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get the number of devices that have not complied to a given policy based on a particular"
+ " device type.",
description = "Get the number of devices that have not complied to a given policy based on a " +
"particular device type.",
key = "cdmf:dashboard:filtered-count",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get the number of devices that have not complied to a given policy over the total"
+ " number of devices registered with WSO2 EMM.\n",
description = "Get the number of devices that have not complied to a given policy over the total"
+ " number of devices registered with WSO2 EMM.\n",
key = "cdmf:dashboard:non-compliant-count",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get device details of devices based on a particular device type.",
description = "Get device details of devices based on a particular device type.",
key = "cdmf:dashboard:details",
permissions = {"/device-mgt/dashboard/view"}
),
@Scope(
name = "Get device details of non-compliant devices which do not comply to a given policy.",
description = "Get device details of non-compliant devices which do not comply to a given policy.",
key = "cdmf:dashboard:feature-non-compliant",
permissions = {"/device-mgt/dashboard/view"}
)
}
)
@Path("/dashboard") @Path("/dashboard")
@Api(value = "Device Analytics Dashboard", @Api(value = "Device Analytics Dashboard",
description = "Device Analytics Dashboard related information APIs are described here.") description = "Device Analytics Dashboard related information APIs are described here.")
@ -70,13 +137,12 @@ public interface Dashboard {
notes = "Get the details of active, inactive, removed and total number of registered devices in" notes = "Get the details of active, inactive, removed and total number of registered devices in"
+ " WSO2 IoT.", + " WSO2 IoT.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:count-overview")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -127,13 +193,12 @@ public interface Dashboard {
httpMethod = "GET", httpMethod = "GET",
value = "Get the number of unmonitored and non-compliant devices in WSO2 IoT.", value = "Get the number of unmonitored and non-compliant devices in WSO2 IoT.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:vulnerabilities")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -185,13 +250,12 @@ public interface Dashboard {
value = "Get the number of devices that have not complied to a policy that was enforced on a " value = "Get the number of devices that have not complied to a policy that was enforced on a "
+ "device.", + "device.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:non-compliant")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -256,13 +320,12 @@ public interface Dashboard {
value = "Get the number of devices for a given device type, such as connectivity status, " value = "Get the number of devices for a given device type, such as connectivity status, "
+ "potential vulnerability, platform, and ownership.\n", + "potential vulnerability, platform, and ownership.\n",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:by-groups")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -346,13 +409,12 @@ public interface Dashboard {
value = "Get the number of devices that have not complied to a given policy based on a particular" value = "Get the number of devices that have not complied to a given policy based on a particular"
+ " device type.", + " device type.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:device-counts")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -426,13 +488,12 @@ public interface Dashboard {
+ "The device ownership type, such as BYOD or COPE.\n" + "The device platform.\n" + "The device ownership type, such as BYOD or COPE.\n" + "The device platform.\n"
+ "The potential vulnerabilities faced by the devices.", + "The potential vulnerabilities faced by the devices.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:filtered-count")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -519,13 +580,12 @@ public interface Dashboard {
value = "Get the number of devices that have not complied to a given policy over the total" value = "Get the number of devices that have not complied to a given policy over the total"
+ " number of devices registered with WSO2 IoT.\n", + " number of devices registered with WSO2 IoT.\n",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:non-compliant-count")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -595,13 +655,12 @@ public interface Dashboard {
httpMethod = "GET", httpMethod = "GET",
value = "Get device details of devices based on a particular device type.", value = "Get device details of devices based on a particular device type.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:details")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -698,13 +757,12 @@ public interface Dashboard {
httpMethod = "GET", httpMethod = "GET",
value = "Get device details of non-compliant devices which do not comply to a given policy.", value = "Get device details of non-compliant devices which do not comply to a given policy.",
tags = "Dashboard", tags = "Dashboard",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:dashboard:feature-non-compliant")
scopes = {@AuthorizationScope(scope = "/device-mgt/dashboard/view", })
description = "View Dashboard")} }
) )
})
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,

@ -77,19 +77,19 @@ import javax.ws.rs.core.Response;
name = "Getting Details of a Device", name = "Getting Details of a Device",
description = "Getting Details of a Device", description = "Getting Details of a Device",
key = "cdmf:devices:details", key = "cdmf:devices:details",
permissions = {"/device-mgt/devices/owning-device/details"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Delete the device specified by device id", name = "Delete the device specified by device id",
description = "Delete the device specified by device id", description = "Delete the device specified by device id",
key = "cdmf:devices:delete", key = "cdmf:devices:delete",
permissions = {"/device-mgt/devices/owning-device/delete"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Getting Feature Details of a Device", name = "Getting Feature Details of a Device",
description = "Getting Feature Details of a Device", description = "Getting Feature Details of a Device",
key = "cdmf:devices:features", key = "cdmf:devices:features",
permissions = {"/device-mgt/devices/owning-device/features"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Advanced Search for Devices", name = "Advanced Search for Devices",
@ -101,25 +101,25 @@ import javax.ws.rs.core.Response;
name = "Getting Installed Application Details of a Device", name = "Getting Installed Application Details of a Device",
description = "Getting Installed Application Details of a Device", description = "Getting Installed Application Details of a Device",
key = "cdmf:devices:applications", key = "cdmf:devices:applications",
permissions = {"/device-mgt/devices/owning-device/applications"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Getting Device Operation Details", name = "Getting Device Operation Details",
description = "Getting Device Operation Details", description = "Getting Device Operation Details",
key = "cdmf:devices:operations", key = "cdmf:devices:operations",
permissions = {"/device-mgt/devices/owning-device/operations"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Get the details of the policy that is enforced on a device.", name = "Get the details of the policy that is enforced on a device.",
description = "Get the details of the policy that is enforced on a device.", description = "Get the details of the policy that is enforced on a device.",
key = "cdmf:devices:effective-policy", key = "cdmf:devices:effective-policy",
permissions = {"/device-mgt/devices/owning-device/effective-policy"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Getting Policy Compliance Details of a Device", name = "Getting Policy Compliance Details of a Device",
description = "Getting Policy Compliance Details of a Device", description = "Getting Policy Compliance Details of a Device",
key = "cdmf:devices:compliance-data", key = "cdmf:devices:compliance-data",
permissions = {"/device-mgt/devices/owning-device/compliance-data"} permissions = {"/device-mgt/devices/owning-device/view"}
) )
} }
) )

@ -61,13 +61,13 @@ import javax.ws.rs.core.Response;
name = "Getting the Supported Device Platforms", name = "Getting the Supported Device Platforms",
description = "Getting the Supported Device Platforms", description = "Getting the Supported Device Platforms",
key = "cdmf:device-types:types", key = "cdmf:device-types:types",
permissions = {"/device-mgt/device-types/types"} permissions = {"/device-mgt/devices/owning-device/view"}
), ),
@Scope( @Scope(
name = "Get Feature Details of a Device Type", name = "Get Feature Details of a Device Type",
description = "Get Feature Details of a Device Type", description = "Get Feature Details of a Device Type",
key = "cdmf:device-types:features", key = "cdmf:device-types:features",
permissions = {"/device-mgt/device-types/features"} permissions = {"/device-mgt/devices/owning-device/view"}
) )
} }
) )

@ -82,13 +82,13 @@ import java.util.List;
name = "Get the list of groups belongs to current user.", name = "Get the list of groups belongs to current user.",
description = "Get the list of groups belongs to current user.", description = "Get the list of groups belongs to current user.",
key = "cdmf:groups:groups", key = "cdmf:groups:groups",
permissions = {"/device-mgt/groups/groups"} permissions = {"/device-mgt/groups/view"}
), ),
@Scope( @Scope(
name = "Get the count of groups belongs to current user.", name = "Get the count of groups belongs to current user.",
description = "Get the count of groups belongs to current user.", description = "Get the count of groups belongs to current user.",
key = "cdmf:groups:count", key = "cdmf:groups:count",
permissions = {"/device-mgt/groups/count"} permissions = {"/device-mgt/groups/view"}
), ),
@Scope( @Scope(
name = "Add new device group to the system.", name = "Add new device group to the system.",
@ -100,7 +100,7 @@ import java.util.List;
name = "View group specified", name = "View group specified",
description = "View group specified", description = "View group specified",
key = "cdmf:groups:groups-view", key = "cdmf:groups:groups-view",
permissions = {"/device-mgt/groups/groups-view"} permissions = {"/device-mgt/groups/view"}
), ),
@Scope( @Scope(
name = "Update a group", name = "Update a group",
@ -124,31 +124,43 @@ import java.util.List;
name = "View list of roles of a device group", name = "View list of roles of a device group",
description = "View list of roles of a device group", description = "View list of roles of a device group",
key = "cdmf:groups:roles", key = "cdmf:groups:roles",
permissions = {"/device-mgt/groups/roles"} permissions = {"/device-mgt/groups/roles/view"}
), ),
@Scope( @Scope(
name = "View list of devices in the device group", name = "View list of devices in the device group",
description = "View list of devices in the device group", description = "View list of devices in the device group",
key = "cdmf:groups:devices", key = "cdmf:groups:devices",
permissions = {"/device-mgt/groups/devices"} permissions = {"/device-mgt/groups/devices/view"}
), ),
@Scope( @Scope(
name = "View list of device count in the device group", name = "View list of device count in the device group",
description = "View list of device count in the device group", description = "View list of device count in the device group",
key = "cdmf:groups:devices-count", key = "cdmf:groups:devices-count",
permissions = {"/device-mgt/groups/devices/devices-count"} permissions = {"/device-mgt/groups/devices/view"}
), ),
@Scope( @Scope(
name = "Add devices to group", name = "Add devices to group",
description = "Add devices to group", description = "Add devices to group",
key = "cdmf:groups:devices-add", key = "cdmf:groups:devices-add",
permissions = {"/device-mgt/groups/devices/devices-add"} permissions = {"/device-mgt/groups/devices/add"}
), ),
@Scope( @Scope(
name = "Remove devices from group", name = "Remove devices from group",
description = "Remove devices from group", description = "Remove devices from group",
key = "cdmf:groups:devices-remove", key = "cdmf:groups:devices-remove",
permissions = {"/device-mgt/groups/devices/devices-remove"} permissions = {"/device-mgt/groups/devices/remove"}
),
@Scope(
name = "Assign devices to groups",
description = "Assign devices to groups",
key = "cdmf:groups:assign",
permissions = {"/device-mgt/groups/devices/add"}
),
@Scope(
name = "List of groups that have the device",
description = "List of groups that have the device",
key = "cdmf:groups:device",
permissions = {"/device-mgt/groups/devices/view"}
) )
} }
) )
@ -837,12 +849,10 @@ public interface GroupManagementService {
value = "Assign devices to groups", value = "Assign devices to groups",
notes = "Add existing device to device groups.", notes = "Add existing device to device groups.",
tags = "Device Group Management", tags = "Device Group Management",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:groups:assign")
scopes = {@AuthorizationScope(scope = "/device-mgt/groups/devices/add", })
description = "Add devices")}
)
} }
) )
@ApiResponses(value = { @ApiResponses(value = {
@ -891,12 +901,10 @@ public interface GroupManagementService {
value = "List of groups that have the device", value = "List of groups that have the device",
notes = "List of groups that have the device.", notes = "List of groups that have the device.",
tags = "Device Group Management", tags = "Device Group Management",
authorizations = { extensions = {
@Authorization( @Extension(properties = {
value = "permission", @ExtensionProperty(name = Constants.SCOPE, value = "cdmf:groups:device")
scopes = {@AuthorizationScope(scope = "/device-mgt/groups/devices/view", })
description = "Add devices")}
)
} }
) )
@ApiResponses(value = { @ApiResponses(value = {

@ -73,7 +73,7 @@ import javax.ws.rs.core.Response;
name = "Updating the Device Notification Status", name = "Updating the Device Notification Status",
description = "Updating the Device Notification Status", description = "Updating the Device Notification Status",
key = "cdmf:notifications:mark-checked", key = "cdmf:notifications:mark-checked",
permissions = {"/device-mgt/notifications/mark-checked"} permissions = {"/device-mgt/notifications/view"}
) )
} }
) )

@ -75,49 +75,49 @@ import java.util.List;
name = "Getting Details of Policies", name = "Getting Details of Policies",
description = "Getting Details of Policies", description = "Getting Details of Policies",
key = "cdmf:policies:get-details", key = "cdmf:policies:get-details",
permissions = {"/device-mgt/policies/get-details"} permissions = {"/device-mgt/policies/view"}
), ),
@Scope( @Scope(
name = "Getting Details of a Policy", name = "Getting Details of a Policy",
description = "Getting Details of a Policy", description = "Getting Details of a Policy",
key = "cdmf:policies:get-policy-details", key = "cdmf:policies:get-policy-details",
permissions = {"/device-mgt/policies/get-policy-details"} permissions = {"/device-mgt/policies/view"}
), ),
@Scope( @Scope(
name = "Updating a Policy", name = "Updating a Policy",
description = "Updating a Policy", description = "Updating a Policy",
key = "cdmf:policies:update", key = "cdmf:policies:update",
permissions = {"/device-mgt/policies/update"} permissions = {"/device-mgt/policies/manage"}
), ),
@Scope( @Scope(
name = "Removing Multiple Policies", name = "Removing Multiple Policies",
description = "Removing Multiple Policies", description = "Removing Multiple Policies",
key = "cdmf:policies:remove", key = "cdmf:policies:remove",
permissions = {"/device-mgt/policies/remove"} permissions = {"/device-mgt/policies/manage"}
), ),
@Scope( @Scope(
name = "Activating Policies", name = "Activating Policies",
description = "Activating Policies", description = "Activating Policies",
key = "cdmf:policies:activate", key = "cdmf:policies:activate",
permissions = {"/device-mgt/policies/activate"} permissions = {"/device-mgt/policies/manage"}
), ),
@Scope( @Scope(
name = "Deactivating Policies", name = "Deactivating Policies",
description = "Deactivating Policies", description = "Deactivating Policies",
key = "cdmf:policies:deactivate", key = "cdmf:policies:deactivate",
permissions = {"/device-mgt/policies/deactivate"} permissions = {"/device-mgt/policies/manage"}
), ),
@Scope( @Scope(
name = "Applying Changes on Policies", name = "Applying Changes on Policies",
description = "Applying Changes on Policies", description = "Applying Changes on Policies",
key = "cdmf:policies:changes", key = "cdmf:policies:changes",
permissions = {"/device-mgt/policies/changes"} permissions = {"/device-mgt/policies/manage"}
), ),
@Scope( @Scope(
name = "Updating the Policy Priorities", name = "Updating the Policy Priorities",
description = "Updating the Policy Priorities", description = "Updating the Policy Priorities",
key = "cdmf:policies:priorities", key = "cdmf:policies:priorities",
permissions = {"/device-mgt/policies/priorities"} permissions = {"/device-mgt/policies/manage"}
) )
} }
) )

@ -69,43 +69,43 @@ import java.util.List;
name = "Getting Permission Details of a Role", name = "Getting Permission Details of a Role",
description = "Getting Permission Details of a Role", description = "Getting Permission Details of a Role",
key = "cdmf:roles:permissions", key = "cdmf:roles:permissions",
permissions = {"/device-mgt/roles/permissions"} permissions = {"/device-mgt/roles/view"}
), ),
@Scope( @Scope(
name = "Getting the List of Roles", name = "Getting the List of Roles",
description = "Getting the List of Roles", description = "Getting the List of Roles",
key = "cdmf:roles:details", key = "cdmf:roles:details",
permissions = {"/device-mgt/roles/details"} permissions = {"/device-mgt/roles/view"}
), ),
@Scope( @Scope(
name = "Adding a Role", name = "Adding a Role",
description = "Adding a Role", description = "Adding a Role",
key = "cdmf:roles:add", key = "cdmf:roles:add",
permissions = {"/device-mgt/roles/add"} permissions = {"/device-mgt/roles/manage"}
), ),
@Scope( @Scope(
name = "Adding a combined Role", name = "Adding a combined Role",
description = "Adding a combined Role", description = "Adding a combined Role",
key = "cdmf:roles:create-combined-role", key = "cdmf:roles:create-combined-role",
permissions = {"/device-mgt/roles/create-combined-role"} permissions = {"/device-mgt/roles/manage"}
), ),
@Scope( @Scope(
name = "Updating Role Details", name = "Updating Role Details",
description = "Updating Role Details", description = "Updating Role Details",
key = "cdmf:roles:update", key = "cdmf:roles:update",
permissions = {"/device-mgt/roles/update"} permissions = {"/device-mgt/roles/manage"}
), ),
@Scope( @Scope(
name = "Deleting a Role", name = "Deleting a Role",
description = "Deleting a Role", description = "Deleting a Role",
key = "cdmf:roles:delete", key = "cdmf:roles:delete",
permissions = {"/device-mgt/roles/delete"} permissions = {"/device-mgt/roles/manage"}
), ),
@Scope( @Scope(
name = "Adding Users to a Role", name = "Adding Users to a Role",
description = "Adding Users to a Role", description = "Adding Users to a Role",
key = "cdmf:roles:add-users", key = "cdmf:roles:add-users",
permissions = {"/device-mgt/roles/add-users"} permissions = {"/device-mgt/roles/manage"}
) )
} }
) )

@ -30,15 +30,10 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Extension;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Info;
import io.swagger.annotations.ResponseHeader; import io.swagger.annotations.ResponseHeader;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
import org.apache.axis2.transport.http.HTTPConstants; import org.apache.axis2.transport.http.HTTPConstants;
import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.device.mgt.jaxrs.beans.BasicUserInfo; import org.wso2.carbon.device.mgt.jaxrs.beans.BasicUserInfo;
import org.wso2.carbon.device.mgt.jaxrs.beans.BasicUserInfoList; import org.wso2.carbon.device.mgt.jaxrs.beans.BasicUserInfoList;
import org.wso2.carbon.device.mgt.jaxrs.beans.EnrollmentInvitation; import org.wso2.carbon.device.mgt.jaxrs.beans.EnrollmentInvitation;
@ -46,6 +41,7 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.device.mgt.jaxrs.beans.OldPasswordResetWrapper; import org.wso2.carbon.device.mgt.jaxrs.beans.OldPasswordResetWrapper;
import org.wso2.carbon.device.mgt.jaxrs.beans.RoleList; import org.wso2.carbon.device.mgt.jaxrs.beans.RoleList;
import org.wso2.carbon.device.mgt.jaxrs.beans.UserInfo; import org.wso2.carbon.device.mgt.jaxrs.beans.UserInfo;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import javax.validation.Valid; import javax.validation.Valid;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
@ -79,71 +75,71 @@ import java.util.List;
) )
@Scopes( @Scopes(
scopes = { scopes = {
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Adding a User", name = "Adding a User",
description = "Adding a User", description = "Adding a User",
key = "cdmf:users:add", key = "cdmf:users:add",
permissions = {"/device-mgt/users/add"} permissions = {"/device-mgt/users/manage"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Getting Details of a User", name = "Getting Details of a User",
description = "Getting Details of a User", description = "Getting Details of a User",
key = "cdmf:users:details", key = "cdmf:users:details",
permissions = {"/device-mgt/users/details"} permissions = {"/device-mgt/users/view"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Updating Details of a User", name = "Updating Details of a User",
description = "Updating Details of a User", description = "Updating Details of a User",
key = "cdmf:users:update", key = "cdmf:users:update",
permissions = {"/device-mgt/policies/update"} permissions = {"/device-mgt/users/manage"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Deleting a User", name = "Deleting a User",
description = "Deleting a User", description = "Deleting a User",
key = "cdmf:users:delete", key = "cdmf:users:delete",
permissions = {"/device-mgt/policies/delete"} permissions = {"/device-mgt/users/manage"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Getting the Role Details of a User", name = "Getting the Role Details of a User",
description = "Getting the Role Details of a User", description = "Getting the Role Details of a User",
key = "cdmf:users:roles", key = "cdmf:users:roles",
permissions = {"/device-mgt/policies/roles"} permissions = {"/device-mgt/users/view"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Getting Details of Users", name = "Getting Details of Users",
description = "Getting Details of Users", description = "Getting Details of Users",
key = "cdmf:users:user-details", key = "cdmf:users:user-details",
permissions = {"/device-mgt/policies/user-details"} permissions = {"/device-mgt/users/view"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Getting the User Count", name = "Getting the User Count",
description = "Getting the User Count", description = "Getting the User Count",
key = "cdmf:users:count", key = "cdmf:users:count",
permissions = {"/device-mgt/policies/count"} permissions = {"/device-mgt/users/view"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Getting the User existence status", name = "Getting the User existence status",
description = "Getting the User existence status", description = "Getting the User existence status",
key = "cdmf:users:is-exist", key = "cdmf:users:is-exist",
permissions = {"/device-mgt/policies/is-exist"} permissions = {"/device-mgt/users/view"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Searching for a User Name", name = "Searching for a User Name",
description = "Searching for a User Name", description = "Searching for a User Name",
key = "cdmf:users:search", key = "cdmf:users:search",
permissions = {"/device-mgt/policies/search"} permissions = {"/device-mgt/users/view"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Changing the User Password", name = "Changing the User Password",
description = "Adding a User", description = "Adding a User",
key = "cdmf:users:credentials", key = "cdmf:users:credentials",
permissions = {"/device-mgt/policies/credentials"} permissions = {"/login"}
), ),
@org.wso2.carbon.apimgt.annotations.api.Scope( @Scope(
name = "Sending Enrollment Invitations to Users", name = "Sending Enrollment Invitations to Users",
description = "Sending Enrollment Invitations to Users", description = "Sending Enrollment Invitations to Users",
key = "cdmf:users:send-invitation", key = "cdmf:users:send-invitation",
permissions = {"/device-mgt/policies/send-invitation"} permissions = {"/device-mgt/users/manage"}
) )
} }
) )

@ -67,13 +67,13 @@ import javax.ws.rs.core.Response;
name = "Installing an Application (Internal API)", name = "Installing an Application (Internal API)",
description = "Installing an Application (Internal API)", description = "Installing an Application (Internal API)",
key = "cdmf:applications:install", key = "cdmf:applications:install",
permissions = {"/device-mgt/applications/install"} permissions = {"/device-mgt/applications/manage"}
), ),
@Scope( @Scope(
name = "Uninstalling an Application (Internal API)", name = "Uninstalling an Application (Internal API)",
description = "Uninstalling an Application (Internal API)", description = "Uninstalling an Application (Internal API)",
key = "cdmf:applications:uninstall", key = "cdmf:applications:uninstall",
permissions = {"/device-mgt/applications/uninstall"} permissions = {"/device-mgt/applications/manage"}
) )
} }
) )

@ -67,7 +67,7 @@ import javax.ws.rs.core.Response;
name = "Getting Details of a Device", name = "Getting Details of a Device",
description = "Getting Details of a Device", description = "Getting Details of a Device",
key = "cdmf:admin:devices:view", key = "cdmf:admin:devices:view",
permissions = {"/device-mgt/devices/admin/devices/view"} permissions = {"/device-mgt/devices/owning-device/view"}
) )
} }
) )

@ -74,7 +74,7 @@ import javax.ws.rs.core.Response;
name = "Count groups", name = "Count groups",
description = "", description = "",
key = "cdmf:admin-groups:count", key = "cdmf:admin-groups:count",
permissions = {"/device-mgt/admin/groups/count"} permissions = {"/device-mgt/admin/groups/view"}
) )
} }
) )

@ -60,7 +60,7 @@ import javax.ws.rs.core.Response;
name = "View Users", name = "View Users",
description = "View Users", description = "View Users",
key = "cdmf:admin-users:view", key = "cdmf:admin-users:view",
permissions = {"/device-mgt/admin/users/view"} permissions = {"/device-mgt/users/manage"}
) )
} }
) )

Loading…
Cancel
Save