Search in sources :

Example 1 with SecurityAdminService

use of org.onosproject.security.SecurityAdminService in project onos by opennetworkinglab.

the class ReviewCommand method doExecute.

@Override
protected void doExecute() {
    ApplicationAdminService applicationAdminService = get(ApplicationAdminService.class);
    ApplicationId appId = applicationAdminService.getId(name);
    if (appId == null) {
        print("No such application: %s", name);
        return;
    }
    Application app = applicationAdminService.getApplication(appId);
    SecurityAdminService smService = SecurityUtil.getSecurityService();
    if (smService == null) {
        print("Security Mode is disabled");
        return;
    }
    if (accept == null) {
        smService.review(appId);
        printPolicy(smService, app);
    } else if ("accept".equals(accept.trim())) {
        smService.acceptPolicy(appId);
        printPolicy(smService, app);
    } else {
        print("Unknown command");
    }
}
Also used : SecurityAdminService(org.onosproject.security.SecurityAdminService) ApplicationId(org.onosproject.core.ApplicationId) Application(org.onosproject.core.Application) ApplicationAdminService(org.onosproject.app.ApplicationAdminService)

Aggregations

ApplicationAdminService (org.onosproject.app.ApplicationAdminService)1 Application (org.onosproject.core.Application)1 ApplicationId (org.onosproject.core.ApplicationId)1 SecurityAdminService (org.onosproject.security.SecurityAdminService)1