When you install the security provider, it will add a ConditionalPermissionAdmin service to the service registry. At that point, you just look it up and use it like any other service. In the code below, you don't actually show it looking up the service.

-> richard

On 9/28/11 11:33 PM, alphasparc wrote:
Hi,
I am trying to embbed Felix into an Application but I have ran into problems
with the security aspects.
How is the ConditionPermissionAdmin Service actually done?
I have the bundle and install it into the felix framework but at which point
do I actually add the code for conditionpermissionadmin?
When I tried to add it in the felix framework

ConditionalPermissionAdmin cpa = null;
                 ConditionalPermissionUpdate u =
cpa.newConditionalPermissionUpdate();
                 List infos = u.getConditionalPermissionInfos();
                 infos.clear();
                 infos.add(
                         cpa.newConditionalPermissionInfo(null,
                         new ConditionInfo[]{
                             new ConditionInfo(
                             BundleLocationCondition.class.getName(), new
String[]{"file:./Bundles/SignedBundleTest.jar"})
                         },
                         new PermissionInfo[]{
                             new
PermissionInfo(FilePermission.class.getName(), "<<ALL FILES>>",
"read,write,delete"),
                             new
PermissionInfo(NetPermission.class.getName(), "*", "")
                         },
                         ConditionalPermissionInfo.DENY));
                 u.commit();

When I try to run it, it throws java.lang.NullPointerException for all the
Bundles.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to