我用竹子创建了一个插件,里面有一个模块。
atlassian-plugin.xml:
<rest key="REST API Key" path="/plugin/myplugin/api" version="1.0">
<description>Rest API for plugin</description>
</rest>
现在我有一个包含一个方法的类:
@Path("/config/user")
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public class UserService {
@PUT
@Path("/add")
public Response addUser(User user){
return Response.ok().build();
}
}
mybamboo.host:6990/rest/plugin/myplugin/api/config/user/add
任何有权访问该特定 Bamboo 实例的用户都可以访问此特定端点。
现在我的问题是,是否可以仅限制竹管理员而不是所有用户访问此端点?
我知道这可以通过扩展 BambooActionSupport 并实现 GlobalAdminSecurityAware 接口来使用 webwork 操作类。但是是否有类似的方法可以在 rest 模块中完成这种访问控制?