+ Start a Discussion
sfadm sfdevsfadm sfdev 

Get currently logged user from apex

Hello,

I need to take programmatically the currently logged user via apex source code to change the permissions of that user.
Here is my code:
public with sharing class UnlockRecordDuringApprovalController {
 
Opportunity objOpportunity;
 
public UnlockRecordDuringApprovalController(ApexPages.StandardController controller) { 
objOpportunity = (Opportunity)controller.getRecord(); 
}
 
public void processRecord() {
 
}
 
}


Please advise or give example(s) how this can be achieved in Salesforce?
Thank you