CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Check for permissioned relationship
Pages: [1]

Author Topic: Check for permissioned relationship  (Read 440 times)

btc97

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Drupal
  • MySQL version: 5.5.37
  • PHP version: 5.3.3
Check for permissioned relationship
January 31, 2015, 03:24:38 pm
Is there any way to check if a Drupal user (synced with a CiviCRM contact) has a permissioned relationship? I would like to be able to show a block dependent on whether a user has the ability to modify an organisation.

Views seemed like a likely candidate, but I don't see a way...

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Check for permissioned relationship
February 01, 2015, 12:02:04 pm
is the problem that some contacts have the same relationship type to an Org but without the permissioning?

since I don't think Views knows about that permissioning

if so, would it work for you to use a special relationship for such situations

ie if you set the block to be based on 'current user' and then show the Org they are related to?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

btc97

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Drupal
  • MySQL version: 5.5.37
  • PHP version: 5.3.3
Re: Check for permissioned relationship
February 01, 2015, 01:07:40 pm
Thanks Pete.

Yes, some contacts have the same relationship, but not a permissioned relationship. I don't want to show those contacts the block.

Maybe your idea of creating a new relationship for these contacts, e.g. "Admin contact", would be the best way of handling things. Then I could filter for that relationship in Views. That's what you're suggesting right?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Check for permissioned relationship
February 01, 2015, 01:32:30 pm
yep - we often have a 'primary contact' to denote people who should be permissioned

not sure what is involved in getting Views to provide the 'is/not permissioned' as a filter, but it should probably get added to the long list if you want to find it in the wiki - chris chinchilla is kind of the 'holder' of such requests though we often deliver them as our clients bump in to them
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

btc97

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Drupal
  • MySQL version: 5.5.37
  • PHP version: 5.3.3
Re: Check for permissioned relationship
February 01, 2015, 05:37:45 pm
Great, that's the way I'll go then. It will actually be useful to have a way to identify primary contacts!

I think I've read somewhere that the answer to this as "no", but is there a way to make a relationship permissioned by default?

I'm happy to add the Views filter request to the wiki. Is that this page?: http://wiki.civicrm.org/confluence/display/CRMDOC/Drupal+Views%27+Future

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Check for permissioned relationship
February 01, 2015, 05:41:39 pm
ah but the answer is yes now thanks to an extension eileen at fuzion made

you can read about it here

https://civicrm.org/extensions/relationship-permissions-acls

though I can't promise it is 4.5 ready - if you can take a look at it and figure what needs fixing then that would help getting it sorted
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

btc97

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Drupal
  • MySQL version: 5.5.37
  • PHP version: 5.3.3
Re: Check for permissioned relationship
February 02, 2015, 11:31:08 am
Ah, that is a very useful extension! However, having thought about this more I'm beginning to think having an additional relationship type is going to add unnecessary complexity for my use-case, because: all contacts are signing up "on behalf of", so we already have an automated permissioned relationship. True, we could add a "Primary contact" relationship with permission (using a Rule on sign up) and no harm would be done, but it would be redundant. I see I can already do an advanced search for permissioned relationships, so I can find the "primary contacts" that way if I have to.

So now I'm thinking I should go down the API route and create a custom module to identify the permissioned relationship users. Haven't used the API before, but it looks well documented!

Does this seem logical?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Check for permissioned relationship
February 02, 2015, 11:46:22 am
i follow your logic - and while i see a greater gain to having 'permissioned-ness' available as a filter in the civi views code - go where you need to with what you have.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

btc97

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Drupal
  • MySQL version: 5.5.37
  • PHP version: 5.3.3
Re: Check for permissioned relationship
February 03, 2015, 10:28:04 am
Civi Views should definitely have that permissioned-ness filter, and if I was more comfortable coding, I would do it that way!

Thanks again for the direction.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Check for permissioned relationship

This forum was archived on 2017-11-26.