Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Best practice for alerts on a page

Posted on 2016-07-16
3
Medium Priority
?
79 Views
Last Modified: 2016-07-17
Hi All

We have a page that displays data on meeting - these have meta data pertaining to them like IsApproved, IsComplete etc. Users interact with this data and have certain permissions like CanEdit, CanUpdate, CanAdd etc to display warnings or show hide buttons etc.

I have done this routinely with nested if's... or  switch...statements.

This app is a bit more complex, what is best practice for this sort of thing?

Andy
0
Comment
Question by:Andy Green
3 Comments
 
LVL 84

Accepted Solution

by:
David Johnson, CD, MVP earned 1400 total points
ID: 41715072
you could use bitwise AND/OR

int permissions
CanEdit        0x01
CanUpdate 0x02
CanAdd        0x04

user has edit and update  == permission would be 3
edit/update/add                       permission would be 7
update/add                               permission would be 6

There are too many ways of doing this but this is one way
0
 
LVL 27

Assisted Solution

by:BigRat
BigRat earned 600 total points
ID: 41715750
0
 
LVL 3

Author Closing Comment

by:Andy Green
ID: 41716322
Thanks guys - Like the bitwise as its a method I'm familiar with.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question