- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 40 of file SocialGroups.java.
◆ absoluteSyndicate()
static void org.turro.security.SocialGroups.absoluteSyndicate |
( |
List< Contact > |
contacts, |
|
|
Set< String > |
socialGroupIds, |
|
|
Dao |
dao |
|
) |
| |
|
static |
Definition at line 80 of file SocialGroups.java.
82 contacts.forEach(contact -> {
83 socials.synchronizeSocials(contact, socials.flatSocialGroups(
null, socialGroupIds));
85 dao.saveObject(contact);
static SocialGroups instance()
◆ allowedSocialGroups() [1/2]
static Collection<SecurityGroup> org.turro.security.SocialGroups.allowedSocialGroups |
( |
| ) |
|
|
static |
Definition at line 42 of file SocialGroups.java.
43 return SocialGroups.allowedSocialGroups(Authentication.getIContact());
◆ allowedSocialGroups() [2/2]
Definition at line 46 of file SocialGroups.java.
48 if(contact.isAdmin()) {
51 Set<SecurityGroup> socials =
new HashSet<>();
52 contact.getSyndications().forEach(syndication -> {
final Map< String, SecurityGroup > socialGroups
◆ checkCompanyInheritance()
Contact org.turro.security.SocialGroups.checkCompanyInheritance |
( |
Contact |
contact, |
|
|
Dao |
dao |
|
) |
| |
Definition at line 185 of file SocialGroups.java.
186 final Contact current = dao.find(Contact.class, contact.getId());
187 if(current !=
null) {
190 SqlClause.delete(
"Syndication")
191 .where().notIn(
"name", inheritance)
192 .and().equal(
"dynamic",
true)
193 .and().equal(
"contact", current)
197 SqlClause.update(
"Syndication")
198 .set(
"dynamic",
true)
199 .where().in(
"name", inheritance)
200 .and().equal(
"contact", current)
204 List<String> currentNames = SqlClause.select(
"s.name").from(
"Syndication s")
205 .where().equal(
"contact", current)
207 .resultList(String.class);
208 inheritance.stream().filter(name -> !currentNames.contains(name))
210 Syndication syndication =
new Syndication();
211 syndication.setContact(current);
212 syndication.setName(name);
213 syndication.setDynamic(
true);
214 dao.saveObject(syndication);
216 return dao.find(Contact.class, current.getId());
List< String > getInheritedFrom(Contact contact)
◆ checkInheritance() [1/2]
void org.turro.security.SocialGroups.checkInheritance |
( |
Contact |
contact, |
|
|
Dao |
dao |
|
) |
| |
Definition at line 175 of file SocialGroups.java.
176 if(ContactType.juridicals().contains(contact.getType())) {
177 contact.getWorkerSet().getWorkers().forEach(staff -> {
Contact checkCompanyInheritance(Contact contact, Dao dao)
◆ checkInheritance() [2/2]
static void org.turro.security.SocialGroups.checkInheritance |
( |
List< Contact > |
contacts, |
|
|
Dao |
dao |
|
) |
| |
|
static |
Definition at line 103 of file SocialGroups.java.
105 contacts.forEach(contact -> {
106 socials.checkInheritance(contact, dao);
◆ flatRoles()
Set<String> org.turro.security.SocialGroups.flatRoles |
( |
Set< Syndication > |
syndications | ) |
|
Definition at line 152 of file SocialGroups.java.
154 syndications.forEach(syndication -> {
155 SecurityGroup sg =
socialGroups.get(syndication.getName());
157 flatRoles.addAll(sg.getRoles());
Set< String > flatRoles(Set< Syndication > syndications)
◆ flatSocialGroups()
Set<String> org.turro.security.SocialGroups.flatSocialGroups |
( |
Contact |
contact, |
|
|
Set< String > |
socials |
|
) |
| |
Definition at line 140 of file SocialGroups.java.
141 Set<String> flatSocials =
new HashSet<>();
142 if(contact !=
null) {
143 flatSocials.addAll(contact.getSyndications().stream()
144 .map(syndication -> syndication.getName()).collect(Collectors.toSet()));
146 socials.forEach(social -> {
void recurseSocialGroups(Set< String > flatSocials, SecurityGroup sg)
◆ flatTags()
Set<String> org.turro.security.SocialGroups.flatTags |
( |
Set< Syndication > |
syndications | ) |
|
Definition at line 164 of file SocialGroups.java.
165 Set<String>
flatTags =
new HashSet<>();
166 syndications.forEach(syndication -> {
167 SecurityGroup sg =
socialGroups.get(syndication.getName());
169 flatTags.addAll(sg.getTags());
Set< String > flatTags(Set< Syndication > syndications)
◆ getInheritedFrom()
List<String> org.turro.security.SocialGroups.getInheritedFrom |
( |
Contact |
contact | ) |
|
Definition at line 223 of file SocialGroups.java.
224 List<String> inheritance =
new ArrayList<>();
225 if(contact !=
null) {
226 contact.getBusinessSet().getBusinessList().forEach(business -> {
227 inheritance.addAll(business.getSyndications().stream()
228 .filter(syndication -> syndication.getSocialGroup().isInherits())
229 .map(syndication -> syndication.getName())
◆ instance()
static SocialGroups org.turro.security.SocialGroups.instance |
( |
| ) |
|
|
static |
◆ removeSocials()
void org.turro.security.SocialGroups.removeSocials |
( |
Contact |
contact, |
|
|
Set< String > |
socialGroupIds |
|
) |
| |
Definition at line 112 of file SocialGroups.java.
113 contact.getSyndications().removeIf(syndication -> socialGroupIds.contains(syndication.getName()));
◆ resyndicate()
static void org.turro.security.SocialGroups.resyndicate |
( |
List< Contact > |
contacts, |
|
|
Dao |
dao |
|
) |
| |
|
static |
Definition at line 90 of file SocialGroups.java.
92 Set<String> socialGroupIds =
new HashSet<>();
93 contacts.forEach(contact -> {
94 socials.synchronizeSocials(contact, socials.flatSocialGroups(contact, socialGroupIds));
96 dao.saveObject(contact);
◆ synchronizeSocials()
void org.turro.security.SocialGroups.synchronizeSocials |
( |
Contact |
contact, |
|
|
Set< String > |
socialGroupIds |
|
) |
| |
Definition at line 116 of file SocialGroups.java.
117 contact.getSyndications().removeIf(syndication -> !socialGroupIds.contains(syndication.getName()));
118 Set<String> syndicationNames = contact.getSyndications().stream()
119 .map(syndication -> syndication.getName()).collect(Collectors.toSet());
120 socialGroupIds.stream().filter(social -> !syndicationNames.contains(social)).forEach(social -> {
121 Syndication syndication =
new Syndication();
122 syndication.setContact(contact);
123 syndication.setName(social);
124 contact.getSyndications().add(syndication);
◆ synchronizeTags()
void org.turro.security.SocialGroups.synchronizeTags |
( |
Contact |
contact, |
|
|
Set< String > |
tags |
|
) |
| |
Definition at line 129 of file SocialGroups.java.
130 Set<String> currentTags = Tags.getTags(contact).stream()
131 .map(tag -> tag.getTagName()).collect(Collectors.toSet());
132 currentTags.stream().filter(tag -> !tags.contains(tag) &&
possibleTag(tag)).forEach(tag -> {
133 Tags.removeTag(contact, tag);
135 tags.stream().filter(tag -> !currentTags.contains(tag)).forEach(tag -> {
136 Tags.addTag(contact, tag);
boolean possibleTag(String tag)
◆ syndicate()
static void org.turro.security.SocialGroups.syndicate |
( |
List< Contact > |
contacts, |
|
|
Set< String > |
socialGroupIds, |
|
|
Dao |
dao |
|
) |
| |
|
static |
Definition at line 60 of file SocialGroups.java.
62 contacts.forEach(contact -> {
63 socials.synchronizeSocials(contact, socials.flatSocialGroups(contact, socialGroupIds));
65 dao.saveObject(contact);
◆ unsyndicate()
static void org.turro.security.SocialGroups.unsyndicate |
( |
List< Contact > |
contacts, |
|
|
Set< String > |
socialGroupIds, |
|
|
Dao |
dao |
|
) |
| |
|
static |
Definition at line 70 of file SocialGroups.java.
72 contacts.forEach(contact -> {
73 socials.removeSocials(contact, socials.flatSocialGroups(
null, socialGroupIds));
75 dao.saveObject(contact);
The documentation for this class was generated from the following file: