use of org.osgi.framework.CapabilityPermission in project onos by opennetworkinglab.
the class DefaultPolicyBuilder method getPermission.
private static Permission getPermission(org.onosproject.security.Permission permission) {
String classname = permission.getClassName();
String name = permission.getName();
String actions = permission.getActions();
if (classname == null || name == null) {
return null;
}
classname = classname.trim();
name = name.trim();
actions = actions.trim();
if (AppPermission.class.getName().equals(classname)) {
return new AppPermission(name);
} else if (FilePermission.class.getName().equals(classname)) {
return new FilePermission(name, actions);
} else if (SerializablePermission.class.getName().equals(classname)) {
return new SerializablePermission(name, actions);
} else if (NetPermission.class.getName().equals(classname)) {
return new NetPermission(name, actions);
} else if (RuntimePermission.class.getName().equals(classname)) {
return new RuntimePermission(name, actions);
} else if (SocketPermission.class.getName().equals(classname)) {
return new SocketPermission(name, actions);
} else if (SQLPermission.class.getName().equals(classname)) {
return new SQLPermission(name, actions);
} else if (PropertyPermission.class.getName().equals(classname)) {
return new PropertyPermission(name, actions);
} else if (LoggingPermission.class.getName().equals(classname)) {
return new LoggingPermission(name, actions);
} else if (SSLPermission.class.getName().equals(classname)) {
return new SSLPermission(name, actions);
} else if (AuthPermission.class.getName().equals(classname)) {
return new AuthPermission(name, actions);
} else if (PrivateCredentialPermission.class.getName().equals(classname)) {
return new PrivateCredentialPermission(name, actions);
} else if (DelegationPermission.class.getName().equals(classname)) {
return new DelegationPermission(name, actions);
} else if (javax.security.auth.kerberos.ServicePermission.class.getName().equals(classname)) {
return new javax.security.auth.kerberos.ServicePermission(name, actions);
} else if (AudioPermission.class.getName().equals(classname)) {
return new AudioPermission(name, actions);
} else if (AdaptPermission.class.getName().equals(classname)) {
return new AdaptPermission(name, actions);
} else if (BundlePermission.class.getName().equals(classname)) {
return new BundlePermission(name, actions);
} else if (CapabilityPermission.class.getName().equals(classname)) {
return new CapabilityPermission(name, actions);
} else if (PackagePermission.class.getName().equals(classname)) {
return new PackagePermission(name, actions);
} else if (ServicePermission.class.getName().equals(classname)) {
return new ServicePermission(name, actions);
} else if (AdminPermission.class.getName().equals(classname)) {
return new AdminPermission(name, actions);
// } else if (ConfigurationPermission.class.getName().equals(classname)) {
// return new ConfigurationPermission(name, actions);
} else if (ReflectPermission.class.getName().equals(classname)) {
return new ReflectPermission(name, actions);
}
// AWTPermission, ReflectPermission not allowed
return null;
}
Aggregations