Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

Here are the headlines of a possible solution to answer this question:

Step 1 - Create a designated role

Create a new "role" corresponding to users with (say) 150 points, assume you name the role UsersWith150Points.

Step 2 - Limit access to the flag

Secure the access to the flag to users with role UsersWith150Points.

Step 3 - Create some Rules logic

Any time a user gains points, use a rule to check if the user has at least 150 points. If so, have the Rules module grant access to the UsersWith150Points role.

Similarly, if a user looses points, also use a rule to check if user no longer has at least 150 points. If so, have the Rules module remove access to the UsersWith150Points role.

Sounds easy and pretty forward ... except ... there is no (easy) solution to have a Rules Condition to "check the current user points for a user" (unless you're willing to use custom PHP logic in your Rules Condition). However, the clue to make this rule work anyhow, is to use as a very first Rules Action "Load user points of a user". For an example rule, which is close that what you'd need, refer to "http"https://drupal.stackexchange.com/questions/53693/how-to-create-rule-to-change-user-role-based-on-points-using-user-points-module/207535#207535": you'd only have to add a Rules Action to grant or remove some role (and adapt the user points threshold to your '150').

Here are the headlines of a possible solution to answer this question:

Step 1 - Create a designated role

Create a new "role" corresponding to users with (say) 150 points, assume you name the role UsersWith150Points.

Step 2 - Limit access to the flag

Secure the access to the flag to users with role UsersWith150Points.

Step 3 - Create some Rules logic

Any time a user gains points, use a rule to check if the user has at least 150 points. If so, have the Rules module grant access to the UsersWith150Points role.

Similarly, if a user looses points, also use a rule to check if user no longer has at least 150 points. If so, have the Rules module remove access to the UsersWith150Points role.

Sounds easy and pretty forward ... except ... there is no (easy) solution to have a Rules Condition to "check the current user points for a user" (unless you're willing to use custom PHP logic in your Rules Condition). However, the clue to make this rule work anyhow, is to use as a very first Rules Action "Load user points of a user". For an example rule, which is close that what you'd need, refer to "http://drupal.stackexchange.com/questions/53693/how-to-create-rule-to-change-user-role-based-on-points-using-user-points-module/207535#207535": you'd only have to add a Rules Action to grant or remove some role (and adapt the user points threshold to your '150').

Here are the headlines of a possible solution to answer this question:

Step 1 - Create a designated role

Create a new "role" corresponding to users with (say) 150 points, assume you name the role UsersWith150Points.

Step 2 - Limit access to the flag

Secure the access to the flag to users with role UsersWith150Points.

Step 3 - Create some Rules logic

Any time a user gains points, use a rule to check if the user has at least 150 points. If so, have the Rules module grant access to the UsersWith150Points role.

Similarly, if a user looses points, also use a rule to check if user no longer has at least 150 points. If so, have the Rules module remove access to the UsersWith150Points role.

Sounds easy and pretty forward ... except ... there is no (easy) solution to have a Rules Condition to "check the current user points for a user" (unless you're willing to use custom PHP logic in your Rules Condition). However, the clue to make this rule work anyhow, is to use as a very first Rules Action "Load user points of a user". For an example rule, which is close that what you'd need, refer to "https://drupal.stackexchange.com/questions/53693/how-to-create-rule-to-change-user-role-based-on-points-using-user-points-module/207535#207535": you'd only have to add a Rules Action to grant or remove some role (and adapt the user points threshold to your '150').

Enhance answer
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Here are the headlines of a possible solution to answer this question:

Step 1 - Create a designated role

Create a new "role" corresponding to users with (say) 150 points, assume you calname the role "UsersWith150Points"UsersWith150Points.

Step 2 - Limit access to the flag

Then anySecure the access to the flag to users with role UsersWith150Points.

Step 3 - Create some Rules logic

Any time a user gains points, use a rule to check if the user passes the 150 pointscheck if the user has at least 150 points. If so, have rulesthe Rules module grant access to the "UsersWith150Points"UsersWith150Points role. 

Similarly, if a user looses points, also use a rule to check if user goes below the 150 pointscheck if user no longer has at least 150 points. If so, have rulesthe Rules module remove access to the "UsersWith150Points"UsersWith150Points role.

SecureSounds easy and pretty forward ... except ... there is no (easy) solution to have a Rules Condition to "check the accesscurrent user points for a user" (unless you're willing to use custom PHP logic in your Rules Condition). However, the flagclue to users with role "UsersWith150Points"make this rule work anyhow, is to use as a very first Rules Action "Load user points of a user".

With For an example rule, which is close that what you'd need, yourefer to "http://drupal.stackexchange.com/questions/53693/how-to-create-rule-to-change-user-role-based-on-points-using-user-points-module/207535#207535": you'd only have everything you would needto add a Rules Action to grant or remove some role (and adapt the user points threshold to your '150').

Create a new "role" corresponding to users with (say) 150 points, assume you cal the role "UsersWith150Points".

Then any time a user gains points, use a rule to check if the user passes the 150 points. If so, have rules grant access to the "UsersWith150Points" role. Similarly, if a user looses points, also use a rule to check if user goes below the 150 points. If so, have rules remove access to the "UsersWith150Points" role.

Secure the access to the flag to users with role "UsersWith150Points".

With that, you have everything you would need.

Here are the headlines of a possible solution to answer this question:

Step 1 - Create a designated role

Create a new "role" corresponding to users with (say) 150 points, assume you name the role UsersWith150Points.

Step 2 - Limit access to the flag

Secure the access to the flag to users with role UsersWith150Points.

Step 3 - Create some Rules logic

Any time a user gains points, use a rule to check if the user has at least 150 points. If so, have the Rules module grant access to the UsersWith150Points role. 

Similarly, if a user looses points, also use a rule to check if user no longer has at least 150 points. If so, have the Rules module remove access to the UsersWith150Points role.

Sounds easy and pretty forward ... except ... there is no (easy) solution to have a Rules Condition to "check the current user points for a user" (unless you're willing to use custom PHP logic in your Rules Condition). However, the clue to make this rule work anyhow, is to use as a very first Rules Action "Load user points of a user". For an example rule, which is close that what you'd need, refer to "http://drupal.stackexchange.com/questions/53693/how-to-create-rule-to-change-user-role-based-on-points-using-user-points-module/207535#207535": you'd only have to add a Rules Action to grant or remove some role (and adapt the user points threshold to your '150').

Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Create a new "role" corresponding to users with (say) 150 points, assume you cal the role "UsersWith150Points".

Then any time a user gains points, use a rule to check if the user passes the 150 points. If so, have rules grant access to the "UsersWith150Points" role. Similarly, if a user looses points, also use a rule to check if user goes below the 150 points. If so, have rules remove access to the "UsersWith150Points" role.

Secure the access to the flag to users with role "UsersWith150Points".

With that, you have everything you would need.