Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:30:26+00:00 2026-06-12T10:30:26+00:00

I have to build a pretty complex application using Backbone Marionette. The user interface

  • 0

I have to build a pretty complex application using Backbone Marionette. The user interface has to handle multiple users with different roles. For example the ‘admin’ user will see the complete menu whereas the ‘guest’ user will access a subset of the same menu. Moreover some views will be accessible to all the users but the functions inside them (add, edit, delete) need to be profiled on the different roles.

I am not sure about the right approach to use in order to solve this issue. I could have different templates for the different roles but in this case plenty of code will be duplicated inside them. Is there any best practice (or maybe some example) to sort my problem out using Marionette?

Thanks in advance,
Fabrizio

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:30:28+00:00Added an answer on June 12, 2026 at 10:30 am

    I would keep a mypermissions object and then write logic in the itemview to handle the different cases. You can make a CSS class called “hide” that is set to

    display:none

    Then you just add that class
    This could be done without changing the template.

    Here’s an example in Coffeescript (not tested or anything)

    AuthView = Backbone.Marionette.ItemView.extend
        template: '#auth-template'          
        onRender: ->
            @checkpermissions()
        checkpermissions: -> 
            if (mypermissions.isUser)
                $(".delete").addClass 'hide'
                $(".add").addClass 'hide'
            elseif (mypermissions.isAdmin)
                $(".delete").removeClass 'hide'
                $(".add").removeClass 'hide'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty complex web-application where the whole DAO has been outsourced to
I have pretty sophisticated build using gradle - with a number of own gradle
So I've got a pretty complex project. I'm using both interface builder and xcode
I have build a webapplication using ASP.NET MVC and JQuery. On my local machine
I have build a c# class library verification.dll using OpenCVSharp. This references OpenCvSharp.dll in
I have build my very first application to Android and I want now to
I'm using Ruby on Rails to develop a web application. I have a wiki
I have to build a web application in a couple of weeks in your
I have this class that I wanted to build using TDD, but I failed.
CC.Net is pretty cool and we have been using it in our organisation for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.