diff options
author | 2017-09-20 13:20:42 +0300 | |
---|---|---|
committer | 2017-09-20 13:37:03 +0300 | |
commit | 9dfd7e28c1eb348fcb4a2de8c6faae2a01b34942 (patch) | |
tree | c273862f59b0b64c19ccfea5f59ab574071cb323 /vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java | |
parent | c3722d135481cfab5978c84853d8229d1e7d9cb3 (diff) |
Global Read only role, Support VID specific Roles
Issue-ID: VID-46 , VID-47
Change-Id: Ib100d20ac40a65d39e27a6e2741b19a173a2b8ea
Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java')
-rw-r--r-- | vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java new file mode 100644 index 00000000..75f505f2 --- /dev/null +++ b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java @@ -0,0 +1,31 @@ +package org.openecomp.vid.aai; + +import org.openecomp.vid.model.Subscriber; +import org.openecomp.vid.model.SubscriberList; +import org.openecomp.vid.roles.RoleValidator; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Oren on 7/5/17. + */ +public class SubscriberListWithFilterData { + + public SubscriberListWithFilterData(SubscriberList subscriberList, RoleValidator roleValidator){ + List<Subscriber> subscribers = subscriberList.customer; + List<SubscriberWithFilter> subscribersWithFilter = new ArrayList<>(); + for (Subscriber subscriber :subscribers){ + SubscriberWithFilter subscriberWithFilter = new SubscriberWithFilter(); + subscriberWithFilter.setIsPermitted(roleValidator.isSubscriberPermitted(subscriber.globalCustomerId)); + subscriberWithFilter.subscriberType = subscriber.subscriberType; + subscriberWithFilter.resourceVersion = subscriber.resourceVersion; + subscriberWithFilter.subscriberName = subscriber.subscriberName; + subscriberWithFilter.globalCustomerId = subscriber.globalCustomerId; + subscribersWithFilter.add(subscriberWithFilter); + } + this.customer = subscribersWithFilter; + } + + public List<SubscriberWithFilter> customer; +} |