Sharing enables record-level access control for all custom objects, as well as many standard objects.

learn more… | top users | synonyms

6
votes
2answers
68 views

When to use with sharing or without sharing?

I am always unsure whether to use with sharing or without sharing in my classes or to just leave that out. The documentation is part of my confusion. Any practical hints? When do you use it and in ...
7
votes
1answer
70 views

Is there a way to share account records to a user without sharing to someone above that user in the role hierarchy?

I have an odd sharing requirement. I need almost all accounts to be public read/write for all internal users. A few accounts that are marked as private should only be visible to the owner and a few ...
2
votes
1answer
29 views

Sharing / without sharing and @RemoteAction

I have a global class (without sharing). One of its method is a @RemoteAction, which instantiate another class (public and without sharing) and uses one method of the instantiated class. This method ...
3
votes
1answer
22 views

Why can't my SFDC Staffing Coordinator add a shared resource to an Assignment?

Currently working my way through Addison Wesley's Development with the Force.com Platform; having a problem on page 90. I've created all the requisite sObjects and profiles, as described in the book. ...
5
votes
1answer
41 views

If a standard or VF page action causes a trigger to fire, does the trigger execute in the system context?

Assuming that the trigger only instantiates classes that are marked as without sharing does that trigger fire in the system context for: A standard object page A VF page with a controller or ...
7
votes
1answer
62 views

Ignore user context while sending SingleEmailMessage

Can we send SingleEmailMessage(s) under admin context and ignore current user sharings and profile access. Details: - visualforce email template is related to object B which is not available for users ...
1
vote
1answer
42 views

org wide defaults for an object explanation of settings

If I set up the OWD for an object a, with out sharing rules, manual sharing, or role heiarchy what can we expect to see? For Private- do they see only records they own? or that users in their role ...
4
votes
1answer
76 views

Can HVCP users see all records?

For a custom object, OWD is private View all is unchecked Yet, HVCP user can see other people's records for that custom object. Is this expected because HVCP users are not part of Role ...
2
votes
1answer
36 views

How to control field visibility for Public group

I have a custom field on a custom object, that field needs to be editable for a public group and for rest of the users/profile this should be read only. How would I manage to achieve this.
1
vote
1answer
82 views

revoking apex managed sharing permission

I'm using apex managed sharing to grant permissions very similar to how it is done in this example trigger: ...
6
votes
3answers
99 views

Dynamic implementation of class using with sharing or without sharing based on certain conditions

I have one checkbox on my vf page.when i select this i want that the class to which this VF page is referring should work in with sharing mode and when i deselect it class should work in without ...
4
votes
1answer
36 views

Allowing Certain Users To See/Search Certain Records Only

I believe this functionality is built into SF, but I am not familiar with it and our company may be needing it soon. How do I allow certain users to only be able to see (or search) specific records? ...
1
vote
1answer
68 views

Sharing Rule & Child Objects

The Object Relationship is as below: DEAL (Parent, Private) -> WPV (Child) -> Check List (G Child) The checklist Grand Child Object has a Field called Governance Lead which looks up to the standard ...
1
vote
1answer
54 views

How to make all contacts visible to the sites guest user?

I'm building a basic sites page that displays a bunch of widgets based on a contacts address. It references code in a managed package, so I don't have the ability to use without sharing in the ...
2
votes
2answers
105 views

Show “Insufficient Privileges” directly when clicking 'Edit' (override), not on 'Save'

If a user clicks 'Edit' on an opportunity which he isn't allowed to edit, the "Insufficient Privileges" page directly appears. This is good. If a user clicks 'Edit' on a custom object (which has an ...
4
votes
2answers
65 views

If sharing rules are used should a where clause still be applied to a SOQL query?

If a portal user only has permission to access a subset of records, defined via sharing rules, should the SOQL still use a WHERE clause, or should it be left off of the query? List<MyObject__c> ...
4
votes
3answers
99 views

Get object sharing setting on Organization-Wide Defaults

Is it possible to know, via apex code, if a certain object is Private, Public Read-Only or Public Read/Write?
2
votes
1answer
60 views

Sending mail notification for manual sharing

I have custom object which is private where users share records with other users manually. I want to send email notification to the shared user whenever a record is shared to him. How can I achieve ...
3
votes
1answer
69 views

Need Custom Trigger to Preserve Sharing Settings

This is an issue raised by a user. Any ideas on how to tackle this? I am guessing that a custom trigger is required but i have no idea on how to go about it. Any help would be much appreciated. T ...
1
vote
3answers
61 views

Sharing with all the users of a profile

I want to share all the records of a custom object created by customer portal users with all the users of a particular profile. As of now, org-wide-setting of the object is private. Any thoughts?
1
vote
1answer
101 views

Querying for OpportunityShare Rule

I am writing a trigger that looks up to a parent (Lookup) Opportunity from a custom object, and am coming across an interesting problem. I have a sharing rule set up on the Opportunity to grant Edit ...
4
votes
3answers
178 views

Exposing the contract object in the customer portal

I have a customer portal where we expose different types of records to users who need to see only records that belong to the same Account as theirs. The portal is built using Visualforce pages and a ...
6
votes
5answers
176 views

Can you limit the visibility of fields based on record ownership?

I know with permission sets and sharing rules you can limit visibility and how users can interact with entire records. IS there any way to limit visibility of fields? We are looking to make the basic ...
1
vote
1answer
52 views

How can I give all users access to all records/objects without giving all users permission to approve an approval-process step not assigned to them?

I have always given users View All and Modify All permissions because it was crucial that every employee could see all data in our org. However, we have begun using Approval Processes as sort of ...
0
votes
1answer
75 views

Records access on customer portal

when I create a child record linked to the parent and that child has lookup to Contact X, I want to share the parent with contact X How can I do that?
3
votes
1answer
218 views

Can we use Dynamic Apex to Share a Record?

One of the most common use cases not supported by sharing rules is when we have a lookup field to the user object and whomever is selected in the lookup field will automatically get read/write access ...
3
votes
1answer
163 views

Unit-Testing Sites Permission Involving a Sharing Rule with Unit-Test Created Data

We currently have a Salesforce Site, and we're trying to add some unit-tests, around permissions and sharing rules that need to be set. We've smoke tested everything via the UI, and permissions appear ...
0
votes
1answer
96 views

PLSQL exception in SFDC any thoughts?

Content cannot be displayed: java.sql.SQLException: ORA-30006: resource busy; acquire with WAIT timeout expiredORA-06512: at "SLEEPY.CAPEX", line 2715ORA-06512: at line 1: SQLException while executing ...
2
votes
2answers
126 views

Sites / Customer Portal Sharing Capabilities

We'd like to build a web application based on force.com Sites and Customer Portal Licenses to have authenticated named users. The data model consist of some custom objects. Now the end users should ...
4
votes
3answers
145 views

Database.com licenses in a Salesforce org

It seems it is possible add Database.com users into a 'normal' Salesforce.com org (i.e. a standard EE or UE org) to allow large numbers of users cheaper access to API and OAuth based authentication. ...
4
votes
1answer
117 views

Assign sharing reasons from Dynamically from APEX

Was wondering if there is way to assign the Sharing Reason aka Rowcause Dynamically. Well tried to implement using this "Schema.MyCustomObject__Share.rowCause.My_Sharing_Reason__c" but here I have to ...
1
vote
2answers
162 views

Does a user need to be the Account Owner to add Opportunity Team Members

I am trying to use standard Opportunity Team Member functionality and it doesn't seem to match the documentation. I have the following sharing model account: public read/write opportunity: private ...
3
votes
1answer
53 views

Insert sObject share for task that the user doesn't own

As a regular user (not system administrator) is it possible to create a share for a object that I'm not the owner of in APEX? Or will the DML statement throw an error?
4
votes
2answers
125 views

Determine if a user has a license to package for sharing

I'm trying to do some checks that insert a custom sObject share to determine if that sObject is set to 'Public Read Only', see this question: Determine org. wide security on an object However, ...
5
votes
5answers
404 views

“Lock” Old Opportunities so They Can't Be Edited

For auditing purposes, we'd like to lock Opportunities that have been closed for 90 or more days so that they can't be edited anymore, (except perhaps for a super-user profile, but you don't need to ...
3
votes
1answer
90 views

Determine org. wide security on an object

I'm trying to determine (in APEX) what the security level is of a custom sObject (for a UI) For example: mysObject__c (Public Read Only, Private, etc.) I know it's possible to test the by inserting ...
2
votes
1answer
186 views

Create new sharing reason from APEX

Is there a way to create a new sharing reason via APEX? Or this is only possible via the Metadata api? Sharing reasons documentation And if not -- is it possible to specify the 'Reason' when ...
2
votes
1answer
61 views

Triggering to check for changes in org level sharing rules

Does anyone have a solution for checking for changes in sObject__Share settings on particular objects in APEX
3
votes
2answers
349 views

High Volume Customer Portal user - Insufficient Privileges for non-image Documents

First, I do not have this issue with images since by marking them as Externally Available allows them to be accessed from the ImageServer servlet which does not have this problem. Second, to ...
5
votes
3answers
987 views

Can I find out if the current user has access to a record without querying?

I run a query from an apex class (with sharing), and I get no results I can be sure the user doesn't have permissions (if I know otherwise that the records do exist). But can I get this information ...