Added scopes to APIs

4.x.x
mharindu 8 years ago
parent ff82accb48
commit aa6085ac8c

@ -79,7 +79,7 @@
<copy todir="${basedir}/../../../repository/deployment/server/webapps"
overwrite="true">
<fileset dir="${basedir}/target">
<include name="api#scep-mgt#v1.0.war"/>
<include name="api-scep-mgt-v1.0.war"/>
</fileset>
</copy>
</tasks>

@ -48,7 +48,7 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>WEB-INF/lib/*cxf*.jar</packagingExcludes>
<warName>api#certificate-mgt#v1.0</warName>
<warName>api-certificate-mgt-v1.0</warName>
</configuration>
</plugin>
</plugins>
@ -75,7 +75,7 @@
<copy todir="${basedir}/../../../repository/deployment/server/webapps"
overwrite="true">
<fileset dir="${basedir}/target">
<include name="api#certificate-mgt#v1.0.war"/>
<include name="api-certificate-mgt-v1.0.war"/>
</fileset>
</copy>
</tasks>

@ -1,6 +1,7 @@
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.CertificateList;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.EnrollmentCertificate;
@ -11,6 +12,10 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@API(name = "Certificate Management", version = "1.0.0",
context = "api-device-mgt-android-v1.0/admin/certificates",
tags = {"devicemgt_admin"})
@Api(value = "Certificate Management", description = "This API carries all certificate management related operations " +
"such as get all the available devices, etc.")
@Path("/admin/certificates")
@ -72,7 +77,7 @@ public interface CertificateManagementAdminService {
message = "Internal Server Error. \n Server error occurred while adding certificates.",
response = ErrorResponse.class)
})
@Permission(scope = "certificate-modify", roles = {"admin"})
@Permission(scope = "certificate:add", roles = {"admin"})
Response addCertificate(
@ApiParam(
name = "enrollmentCertificates",
@ -130,7 +135,7 @@ public interface CertificateManagementAdminService {
"Server error occurred while retrieving information requested certificate.",
response = ErrorResponse.class)
})
@Permission(scope = "certificate-view", roles = {"emm-admin"})
@Permission(scope = "certificate:view", roles = {"admin"})
Response getCertificate(
@ApiParam(name = "serialNumber",
value = "Provide the serial number of the certificate that you wish to get the details of",
@ -202,7 +207,7 @@ public interface CertificateManagementAdminService {
"Server error occurred while retrieving all certificates enrolled in the system.",
response = ErrorResponse.class)
})
@Permission(scope = "certificate-view", roles = {"emm-admin"})
@Permission(scope = "certificate:view", roles = {"admin"})
Response getAllCertificates(
@ApiParam(
name = "offset",
@ -245,7 +250,7 @@ public interface CertificateManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while removing the certificate.",
response = ErrorResponse.class)})
@Permission(scope = "certificate-modify", roles = {"emm-admin"})
@Permission(scope = "certificate:modify", roles = {"admin"})
Response removeCertificate(
@ApiParam(
name = "serialNumber",

@ -142,8 +142,7 @@ public interface NotificationManagementService {
message = "Error occurred while updating notification status.")
}
)
@Permission(scope = "notification:modify", roles = {"admin"}
)
@Permission(scope = "notification:view", roles = {"admin"})
Response updateNotificationStatus(
@ApiParam(
name = "id",

@ -77,7 +77,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while fetching requested list of roles.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:list", roles = {"admin"})
@Permission(scope = "role:list", roles = {"admin"})
Response getRoles(
@ApiParam(
name = "filter",
@ -159,7 +159,7 @@ public interface RoleManagementService {
message = "Internal Server ErrorResponse. \n Server error occurred while fetching the permission list of the requested role.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:view", roles = {"admin"})
@Permission(scope = "role:view", roles = {"admin"})
Response getPermissionsOfRole(
@ApiParam(
name = "roleName",
@ -222,7 +222,7 @@ public interface RoleManagementService {
"requested role.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:view", roles = {"admin"})
@Permission(scope = "role:view", roles = {"admin"})
Response getRole(
@ApiParam(
name = "roleName",
@ -282,7 +282,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while adding a new role.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:add", roles = {"admin"})
@Permission(scope = "role:add", roles = {"admin"})
Response addRole(
@ApiParam(
name = "role",
@ -332,7 +332,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while updating the role.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:modify", roles = {"admin"})
@Permission(scope = "role:modify", roles = {"admin"})
Response updateRole(
@ApiParam(
name = "roleName",
@ -369,7 +369,7 @@ public interface RoleManagementService {
message = "Internal Server Error. \n Server error occurred while removing the role.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:modify", roles = {"admin"})
@Permission(scope = "role:modify", roles = {"admin"})
Response deleteRole(
@ApiParam(
name = "roleName",
@ -427,7 +427,7 @@ public interface RoleManagementService {
"Server error occurred while updating the user list of the role.",
response = ErrorResponse.class)
})
@Permission(scope = "roles:modify", roles = {"admin"})
@Permission(scope = "role:add", roles = {"admin"})
Response updateUsersOfRole(
@ApiParam(
name = "roleName",

@ -82,7 +82,7 @@ public interface UserManagementService {
message = "Internal Server Error. \n Server error occurred while adding a new user.",
response = ErrorResponse.class)
})
@Permission(scope = "user-modify", roles = {"emm-admin"})
@Permission(scope = "user:add", roles = {"admin"})
Response addUser(
@ApiParam(
name = "user",
@ -134,7 +134,7 @@ public interface UserManagementService {
" fetching the requested user.",
response = ErrorResponse.class)
})
@Permission(scope = "user-view", roles = {"emm-admin"})
@Permission(scope = "user:view", roles = {"admin"})
Response getUser(
@ApiParam(
name = "username",
@ -191,7 +191,7 @@ public interface UserManagementService {
"Server error occurred while updating the user.",
response = ErrorResponse.class)
})
@Permission(scope = "user-modify", roles = {"emm-admin"})
@Permission(scope = "user:modify", roles = {"admin"})
Response updateUser(
@ApiParam(
name = "username",
@ -226,7 +226,7 @@ public interface UserManagementService {
response = ErrorResponse.class
)
})
@Permission(scope = "user-modify", roles = {"emm-admin"})
@Permission(scope = "user:modify", roles = {"admin"})
Response removeUser(
@ApiParam(name = "username", value = "Username of the user to be deleted.", required = true)
@PathParam("username") String username);
@ -275,7 +275,7 @@ public interface UserManagementService {
" assigned to the user.",
response = ErrorResponse.class)
})
@Permission(scope = "user-view", roles = {"emm-admin"})
@Permission(scope = "user:view", roles = {"admin"})
Response getRolesOfUser(
@ApiParam(name = "username", value = "Username of the user.", required = true)
@PathParam("username") String username);
@ -318,7 +318,7 @@ public interface UserManagementService {
message = "Internal Server Error. \n Server error occurred while fetching the user list.",
response = ErrorResponse.class)
})
@Permission(scope = "user-view", roles = {"emm-admin"})
@Permission(scope = "user:list", roles = {"admin"})
Response getUsers(
@ApiParam(
name = "filter",
@ -385,7 +385,7 @@ public interface UserManagementService {
"list that matches the given filter.",
response = ErrorResponse.class)
})
@Permission(scope = "user-view", roles = {"emm-admin"})
@Permission(scope = "user:view", roles = {"admin"})
Response getUserNames(
@ApiParam(
name = "filter",
@ -439,7 +439,7 @@ public interface UserManagementService {
"Server error occurred while updating credentials of the user.",
response = ErrorResponse.class)
})
@Permission(scope = "user-modify", roles = {"emm-admin"})
@Permission(scope = "user:modify", roles = {"admin"})
Response resetPassword(
@ApiParam(
name = "username",

@ -59,7 +59,7 @@
<outputDirectory>
${project.build.directory}/maven-shared-archive-resources/webapps
</outputDirectory>
<destFileName>api#certificate-mgt#v1.0.war</destFileName>
<destFileName>api-certificate-mgt-v1.0.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>

@ -1,2 +1,2 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.cert.admin.api_${feature.version}/webapps/api#certificate-mgt#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#certificate-mgt#v1.0.war,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.cert.admin.api_${feature.version}/webapps/api-certificate-mgt-v1.0.war,target:${installFolder}/../../deployment/server/webapps/api-certificate-mgt-v1.0.war,overwrite:true);\
Loading…
Cancel
Save