I am fairly new to ADFS. I understand how to set up issuance claim rules for 'Send group membership as a claim" in the ADFS Management app. But I now have a situation where I have several ad groups that I need to check for and send outgoing values for the same outgoing claim type based on priority. For example a user could be in 2 different groups and one group gets a higher value than the other and would "override" the lower value. I know I can set up rules for both and have the higher one listed first but then the vendor picks up both values. I only want to send across one value (basically an if/then/else type of logic). How would I do this?
For two groups P1 and P2:
Issue P1 if there is one.
c1:[Type == "http://contoso.com/P1"]
=> issue(Type="http://contoso.com/P1", Value=c1.value);
Use a "NOT EXISTS" rule.
NOT EXISTS([Type == "http://contoso.com/P1"])
=> add(Type = "http://contoso.com/noP1", Value = "No");
The value is not important. We just want a claim.
c1:[Type == "http://contoso.com/noP1"] &&
c2:[Type == "http://contoso.com/P2"]
=> issue(Type="http://contoso.com/P2", Value=c2.value);
Related
This question is related to Drupal 8 Group module, https://www.drupal.org/project/group
I am stuck and need help with how to programmatically add a user to a group with a particular role. I am trying to assign a user to a group and role via a feed import but unable to figure out how.
To elaborate, let's say we have two groups DEV and QA. DEV is of group type A and QA is of group type B. Both groups type A & B have roles X, Y and Z (group roles). Now, I have a user $account and I want it to get added to say group QA with role Y. Can someone help and state a way I can achieve this programmatically? Code examples/snippets will be extra helpful.
Some OLD code here that may help. Had to dig it out of git, deleted a couple of years ago as no longer needed by the project. May be deprecated!
You are loading up the group and using the $group->addMember() function. I have just added the member but you can add a second param that is an associative array that can indicate roles to add to.
$new_user = \Drupal\user\Entity\User::load($some_user_id);
// Get the group entity.
$gid = $form_state->getValue('gid');
$group = \Drupal::entityTypeManager()
->getStorage('group')
->load($gid);
// Add user as a member of the group.
$group->addMember($new_user);
// Set the owner of the group to be the user.
$group->set('uid', $new_user_id);
// Save changes to group. Anything below here should only be changes to
// Group Content.
$group->save();
$tags = $group->getCacheTagsToInvalidate();
Cache::invalidateTags($tags);
Suppose I create a parameter with conditions such that users in random percentile < 10% will be assigned a certain value. The client fetches this value parameter and gets this value with 10% probability, if not it gets the default value. Next session the client fetches the same parameter. Will he get the same value again? Do users stay in the same percentile indefinitely or is a dice thrown each time they fetch the parameter value?
From the documentation:
Each app instance is consistently mapped to a random whole or fractional number within a project, so you can use a rule of this type to consistently address the same app instances.
For example, to create two related conditions that each apply to a non-overlapping .05% of an app's user base, you could have one condition include a <= .05% rule, and another condition include both a > .05% rule and a <= .10% rule.
So they receive the same value consistently.
I'm running a query to pull source, medium, some custom dimensions, new sessions (totals.newVisits), sessions (totals.visits) and session duration (totals.timeOnSite).
I get some results where there is a value for totals.newVisits, but not totals.visits. How would that be possible - isn't a new visit supposed to be a subset of all visits?
You have to see these 2 variables ("totals.visits" and "totals.newVisits") as indicators (booleans).
Here, we want to know whether the user have already gone to the website before the visit or he is a returning visitor (totals.newVisits) and whether the user have done an interaction during the session or not (totals.visits).
In that case, it's 2 independent variables.
That is why Google specify these variables like :
The value is null if there are no interaction events in the session.
or
If this is the first visit, this value is 1, otherwise it is null.
You have to really stick into Google's variables definitions : BigQuery variable dictionary
From definition for totals.visits
The value is null if there are no interaction events in the session.
Added
Definition for totals.newVisits
If this is the first visit, this value is 1, otherwise it is null.
how can there be a value for newVisits if there are no interaction events?
I would interpret this as: New User visited page but there was no interaction
See more at BigQuery Export schema
i have a content type and the possibility for logged in users to vote on it. there are 5 different fivestar votings (categories) on the node. now i want to add userpoints and wanted to ask if it is possible that when a user votes that he gets 1 point for every vote on a node, so 5 points if he votes in every category. he has the possibility to change the vote later, but then he shouldn´t get any points anymore. is this possible?
greets
While it doesn't look like there is an existing 7.x or 8.x module that accomplishes this, there are two ways you should be able to accomplish your goal:
Write a module. The Userpoints API is fairly well-documented and it should be possible to create a module to increment a user's userpoint count when a fivestar field is modified. To avoid duplication, note that this field looks like it should accomplish the de-duping you are looking for (assuming you set txn_id to some combination of the current node ID, field ID, and user ID:
'txn_id' => (int) Transaction ID of a current points record. If
present an UPDATE occurs
Use Rules. The userpoints module integrates with Rules, so you should be able to accomplish your userpoints use case without writing any code. According tho the Userpoints Rules integration notes, you can compare the current userpoints to the number of points before the transaction:
Compare Userpoints before the transaction
- This condition is used to compare the amount of userpoints the user had before the userpoints was added to/deducted from the user against a specified value.
- The 'Amount to compare' value is checked as >= (greater than or equal to) and the Negate checkbox will change the condition to < (less than) as it will be any value other than >=. If you would like to get an exact value, say 1, you can add two of the condition to use >= and < to specify one number. Simple math stuff here =)
I hope this helps. Let me know how it goes!
I have some nodes with a widget vote up/down. I can't understand how can i get integer votes value for various actions without sql requery. For example to hide nodes with rating < 10.
No matter what module you use,(Rate, Fivestar or anything else), all the data stored in Voting API module.
Using Rules module and VotingAPI Rules integration module you can check values of votes and take arbitrary(but possible) actions.
You may need to add new triggered rule on even "user votes on content" and check if the vote's value is < 10.
Voting API keeps data as a percentage so < 10 means < 10%. Vote count, value of each vote and percentage available as data.