Roles and Hierarchies in SSAS - security

I'm having an issue with security on an Analysis Services cube.
I have a dimension, that I need to restrict access to, based on a number of secured fields.
The dimension (Animals, for example) has 5 attributes including :
Id
Name
Gender (Secured Field)
Food
Eye Colour
I need to be able to create hierarchies on this, as :
Gender -> Id
Food -> Id
Eye Colour -> Id
There will be two roles on this Cube, one with access to everything, and one with no access to Id's when using secured fields. However, if the user is filtering by Secured fields, they can see totals against the secured field.
So, if querying against Gender, they would see 20 Male and 20 Female, but wouldn't be able to see the Id's of the 20 Males. A secured user would be able to see the 20 Id's though.
Is this possible, and if so, how would you prevent bypassing the security by filtering on Gender = Male and adding another non-secured hierarchy into the query (such as Eye Colour -> Id) to get the Id's that way ?
Thanks for your time

Related

How to connect data in Excel Power Pivot data model with no unique identifier

I am trying to build an Excel Power Pivot data model using restaurant inspection data from my city, though I'm having trouble envisioning how to get this to work properly. I have three files I've imported into the data model but cannot figure out how to link:
business_lookup; each entry is unique with a business ID number, a business name and address.
inspection_lookup; each entry is distinct inspection on a specific date for a specific restaurant but has no unique identifier. It does not distinguish how many violations were found on this visit, just that a visit occured.
violations; a file full of each individual violation found on each of the inspection_lookup dates. It has the business ID, date and a description of the individual specific violation. For each inspection in the inspection_lookup, there are typically multiple corresponding violations in this table.
The problem, to my understanding, is that there's no unique field like "inspection_ID" that could link the inspection_lookup file to each of its many findings in the violations file to allow me to say on June 5, 2020, Jim's Fish House had three violations and they were X, Y and Z. I can connect both to the business_lookup file easily enough, but I can't figure out how to link these other two tables. How can I connect these two other files when all I know is that the unique business ID was inspected on a common date?
If in inspection_lookup you have date and specific restaurant (I assume it corresponds to business ID or business name), you can create unique key by concatenating these 2 columns (given you cannot have more than 1 inspection on the same day in the same restaurant). You can create the same unique key in violations and connect these 2 tables. Business_lookup has unique values so you can connect it to violations or inspection_lookup based on your use case.

I am developing a metrics for risk analysis based on the severity of attacks and attackers skill or knowledge

I am working on a data base of attack patterns which has various attributes like severity of attack, attackers skill, attack likelihood all in the form of values like high, medium and low. I want to develop a metrics for risk analysis based on these attributes. Should I convert low to 1 medium to 2 and high to 3 or use some other normalization technique
Use a lookup table
Create a new table with 2 columns: SeverityID as PK and Severity as a varchar(10)
Add 3 new records to your table with the values "Low", "Medium", and "High". Whenever you want to reference these, you can select the values 1, 2, or 3 from a dropbox which gets its data from this table. Your "AttackDetails" table (for example) will contain a SeverityID which will link to your other table in any query or view, but will still contain the ID of the item you selected. This means if you want to add items later, you can still add them to the lookup table. It also prevents the user from changing between "medium", "MEDIUM" or "normal" (or whatever they decide at the time)

Cassandra data modeling for one-to-many lookup

Consider the problem of storing users and their contacts. There are about a 100 million users, each has a few hundred contacts and on an average contacts are 1kb in size. There may be some users with too many contacts (>5000) and there may be some contacts that are much (say 10x) bigger than the average of 1kb. Users actively add contacts and less often also delete them. Contacts are not pointers to other users but just a bundle of information.
There are two kinds of queries -
Given a user and a contact name, lookup the contact details
Given a user, look up all associated contact names
I was thinking of a contacts table like this -
CREATE TABLE contacts {
user_name text,
contact_name text,
contact_details map<text, text>,
PRIMARY KEY ( (user_name, contact_name) )
// ^ Notice the composite primary key
}
The choice of composite primary key is due to the number and size of contacts per user. I wanted one contact per row.
This table easily addresses the query of looking up a contact's details given a user and a contact name.
I'm looking for suggestions to address the second query.
Two options (with related concerns) on my mind -
Create a second table called contact_names_by_user, with user_name as the partition key and contact_name as a clustering key. Concern: If there a user with way too many contacts (say 20k), would that result in a non-optimally wide row?
Create an index on user_name. Concern: However given the ratio of total number of users (100M) to average contacts per user (say 200), would that value be considered to have high-cardinality, hence bad for indexing?
In general, are there guideline around looking up many items (like contacts here) referred by one item (like user here) without running in wide rows or non-optimal indexes?
Creating index itself should not be a problem IMHO. Average cardinality of 200 sounds good.
Other option is you maintaining your own index like:
CREATE TABLE contacts_by_user (
user_name text PRIMARY KEY,
contacts set
)
though your index and contacts can go out of sync.

An outer join Excel Power Pivot Pivot table?

I have a PowerPivot with two tables one contains a list of facilities, their type (active/inactive) and whether they belong to org A or org B (FaciltyID|Active/Inactive|ORG)
Another table has a list of users and facitilites assigned to them + their org, so it looks like (userID|FacilityID|ORG) where each userID is repeated the number of times that=the number of facilties it has.
Initially I needed to report the number of facilities active and easily built a PivotTable for it.
Now I need to get a list of the facilities that each user is missing , so I need to basically do an outer join between the the tables for each user and I just can't figure out the way to do it! I joined both table on the FacilityID and am able to see whether they have inactive facilties, but can't figure out a way to show all the facilities they are missing!
Thanks
Nonexistence is hard. This is not the sort of thing that is best solved through measures, but through modeling. In your source, you should cross join Facility and User to get FacilityUser. In FacilityUser, every user has 1 row with every facility, and you add a flag to indicate whether the user is or isn't assigned to that facility. Then your problem becomes one of filtering on that flag value. This is solvable in DAX, but you don't want to do that.

How to Sort View control by Lookup column

I have two forms that are related and I would to combine them in a view control. Not that difficult. This is for a "1 to Many" type scenario.
Say I have a customer view with the columns customerID and Customer Name. Then I have a view showing the "many" documents that has the columns masterCustomerID, orderNumber, orderDate.
On the XPage I create a view control of the many documents and add the columns masterCustomerID, orderNumber, orderDate. Then I add a column in the front to do a DbLookup to pull in the actual name of the customer. Nothing too fancy really.
My question is, in this situation, where the lookup column is the FIRST column. What are the strategies to sort the view column by that column. By default it would sort by the Key Value in the order view which is likely different then the Name values.
I'm not averse to using repeat controls if that would be easier.
My first thought would be to employ TreeMaps somehow, but I don't know if that's practical in the event that there might be a LOT of documents. Maybe there's something I'm missing...
Any advice would be appreciated. Thanks
Use view with (Customer name, Customer ID) structure as main view. Then based on Customer ID populate other columns by lookup from view with structure (Customer ID, Order ID, Order date). Hence it is 1:N relationship, you can't use single view component, but two nested - repeat inside view column would do.
I hope you are aware of performance impact (orders looked up for every customer row), so don't try to show too many customers at once.

Resources