Giter VIP home page Giter VIP logo

Comments (1)

afawcett avatar afawcett commented on July 27, 2024

RE: Layouts. This is quite involved, but you can get the main parts of the process by referring to the Retrieve and Deploy demo VF pages and controllers, combine the logic in both of these and place in the middle code to read the layout via the Apex XML library and emit the new XML (via toXmlString() method) to deploy.

RE: Profiles. This in theory would be much the same process as above. However, the Salesforce Metadata API, makes it very hard to retrieve complete Profiles needed to implement such code. If you retrieve a Profile it is only partially complete depending on what else you retrieved, such as custom objects, fields, pages, classes etc. Meaning that in order to get permissions on such things included in the retrieve you also need to retrieve these items, which blows the 3MB callout response limit in Apex wide open.

I would recommend looking at the Permission Set API, which allows you to read Profile owned Permission Sets, from this you can create a new Permission Set (not profile owned). And then assign that to users. This is not the same as cloning a Profile, but has broadly the same effect and moves you closer to the much more flexible Permission Set based approach for managing permissions in an org.

from apex-mdapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.