mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:53:23 +02:00
add groups feature
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
var deviceData = require('stf-device-db')
|
||||
var browserData = require('stf-browser-db')
|
||||
|
||||
@@ -41,13 +45,14 @@ datautil.applyBrowsers = function(device) {
|
||||
}
|
||||
|
||||
datautil.applyOwner = function(device, user) {
|
||||
device.using = !!device.owner && device.owner.email === user.email
|
||||
device.using = !!device.owner &&
|
||||
(device.owner.email === user.email || user.privilege === 'admin')
|
||||
return device
|
||||
}
|
||||
|
||||
// Only owner can see this information
|
||||
datautil.applyOwnerOnlyInfo = function(device, user) {
|
||||
if (device.owner && device.owner.email === user.email) {
|
||||
if (device.owner && (device.owner.email === user.email || user.privilege === 'admin')) {
|
||||
// No-op
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user